[Bug nptl/17478] Fix off-by-one error in pthread_setname_np()

ryao at gentoo dot org sourceware-bugzilla@sourceware.org
Thu Oct 16 14:51:00 GMT 2014


https://sourceware.org/bugzilla/show_bug.cgi?id=17478

--- Comment #7 from Richard Yao <ryao at gentoo dot org> ---
That should have been "The kernel restricts the length of the name to 15
characters." I am still somewhat jet lagged, but I did the analysis on this
*before* left for LinuxCon Europe.

The definition of string length used by strlen() excludes the NULL terminating
character while the definition used by the kernel includes the NULL terminating
character. The discrepancy causes an off-by-one error that must be corrected by
adding 1 to the length returned by `strlen()`.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list