[PATCH] Fix off by one error SmsGenerateClientID when uuid_create is used.

Alexander Kabaev kan at FreeBSD.org
Mon May 24 11:59:54 PDT 2010


From: Alexander Kabaev <kan at FreeBSD.org>

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.
---
 src/sm_genid.c |    2 +-
 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);
     }
 
-- 
1.7.1



More information about the xorg-devel mailing list