mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
linux: Fix __sem_check_add_mapping name length
Take in consideration the trailling NULL since sem_search uses strcmp to compare entries. Checked on x86_64-linux-gnu and powerpc-linux-gnu (where it triggered a nptl/tst-sem7 regression).
This commit is contained in:
@@ -72,6 +72,7 @@ __sem_check_add_mapping (const char *name, int fd, sem_t *existing)
|
|||||||
size_t namelen = strlen (name);
|
size_t namelen = strlen (name);
|
||||||
if (namelen > NAME_MAX)
|
if (namelen > NAME_MAX)
|
||||||
return SEM_FAILED;
|
return SEM_FAILED;
|
||||||
|
namelen += 1;
|
||||||
|
|
||||||
sem_t *result = SEM_FAILED;
|
sem_t *result = SEM_FAILED;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user