Fix the bug in UUID convertor.
authorleechul <chuls.lee@samsung.com>
Tue, 29 Mar 2016 07:01:42 +0000 (16:01 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Tue, 29 Mar 2016 10:57:27 +0000 (10:57 +0000)
commit7959d925e7538bb10066ea45c9191516cd8406ef
tree38cdc1b93e89872693828ee4ce9bff531de7bf8a
parentdfd6a6bc63f329152ca09622a5546df8dd398c62
Fix the bug in UUID convertor.

Previous ConvertStrToUuid() API does not guarantee correct result in case of empty UUID.
Even if input string is empty string,the input string  may contain the garbage except first byte.

Here is bad case for ConvertStrToUuid() API :

Input : b'00 00 00 00 00 00 00 00 00 00 CC CC FF FF FF FF'
Since first byte is NULL character, the input string is empty string exactly.
The expected result is "00000000-0000-0000-0000-000000000000" in case of empty string.
But current ConvertStrToUuid() will be generated "00000000-0000-0000-0000-CCCCFFFFFFFF" for above input.

This patch is intended to fix it.

[Patch #1] Initial upload
[Patch #2] Update commit message
[Patch #3] Update according to comments.
[Patch #4] Update log message.
[Patch #5] Fix the typo on log message according to review comment.

Change-Id: I97c95a8fea30ffdf7e4c4ff6622e083b8357705a
Signed-off-by: leechul <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7431
Reviewed-by: Kyungsun Cho <goodsun.cho@samsung.com>
Reviewed-by: Yonggoo Kang <ygace.kang@samsung.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/src/srmutility.c