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

James Cloos cloos at jhcloos.com
Mon May 24 22:05:29 PDT 2010


>>>>> "AK" == Alexander Kabaev <kan at FreeBSD.org> writes:

AK> From: Alexander Kabaev <kan at FreeBSD.org>
AK> Fix apparent typo in SmsGenerateClientID which always leaves the
AK> first byte of allocated id string uninitialized. If that byte
AK> happens to be 0, SmsGenerateClientId appears to return an empty
AK> string to the caller, instead of proper GUID in text form.
AK> ---
AK>  src/sm_genid.c |    2 +-
AK>  1 files changed, 1 insertions(+), 1 deletions(-)

AK> diff --git a/src/sm_genid.c b/src/sm_genid.c
AK> index 5ec4547..2cd6d26 100644
AK> --- a/src/sm_genid.c
AK> +++ b/src/sm_genid.c
AK> @@ -121,7 +121,7 @@ SmsGenerateClientID(SmsConn smsConn)
 
AK>      if ((id = malloc (strlen (temp) + 2)) != NULL)
AK>      {
AK> -        id[1] = '2';
AK> +        id[0] = '2';
AK>          strcpy (id+1, temp);
AK>      }


[ Based on some grep(1)ing, this patch is for lib/libSM.git -JimC ]

Reviewed-by: James Cloos <cloos at jhcloos.com>

-JimC
-- 
James Cloos <cloos at jhcloos.com>         OpenPGP: 1024D/ED7DAEA6


More information about the xorg-devel mailing list