timer_create null check for 2nd arg (evp)

Kay McCormick kaym at modsystems.com
Fri Feb 9 13:39:09 PST 2007


In timer_create function in librt (librt/timer_create.c) the second
argument should be checked for NULL.  I have third-party (commercial)
code that calls timer_create with evp NULL.  I checked the specs
available online and this is allowable.  So where it says

 

if (__builtin_expect(evp->sigev_notify == SIGEV_THREAD, 1))

            return -1;

 

near the top of the function and file and changed it to

 

if (evp != NULL && __builtin_expect(evp->sigev_notify == SIGEV_THREAD,
1))

            return -1;

 

And this fixes it.  I don't have time to make a patch but I thought
you'd want to know.

 

Kay McCormick

MOD Systems, Inc.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/uclibc/attachments/20070209/e8674d28/attachment.htm 


More information about the uClibc mailing list