summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2010-05-26 13:28:03 -0400
committerAdam Jackson <ajax@redhat.com>2010-05-26 13:29:07 -0400
commitfd37bd0ac012e15bffad7e83d36b87ee3941d6f5 (patch)
treed60b50df0030772be675d7f96bf2ff31b934c52a
parentaf7364c20d91615251b1ec2b19e0cb38e9094ba0 (diff)
Fix off by one error in SmsGenerateClientID when uuid_create is used
Fix apparent typo in SmsGenerateClientID which always leaves the first byte of allocated id string uninitialized. If that byte happens to be 0, SmsGenerateClientId appears to return an empty string to the caller, instead of proper GUID in text form. Reviewed-by: James CLoos <cloos@jhcloos.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--src/sm_genid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sm_genid.c b/src/sm_genid.c
index 5ec4547..2cd6d26 100644
--- a/src/sm_genid.c
+++ b/src/sm_genid.c
@@ -121,7 +121,7 @@ SmsGenerateClientID(SmsConn smsConn)
if ((id = malloc (strlen (temp) + 2)) != NULL)
{
- id[1] = '2';
+ id[0] = '2';
strcpy (id+1, temp);
}