summaryrefslogtreecommitdiff
path: root/src/thread/pthread_mutexattr_setpshared.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2026-03-22 21:32:35 -0400
committerRich Felker <dalias@aerifal.cx>2026-03-30 15:57:10 -0400
commit0572555dab1d1e10b5f7351a005ec588cab41e25 (patch)
tree5f85e38291324d5b1e073d9a4f61641b15f7bf60 /src/thread/pthread_mutexattr_setpshared.c
parent3df932bc33a5f1ae56636abfd4241e34d5c648db (diff)
downloadmusl-0572555dab1d1e10b5f7351a005ec588cab41e25.tar.gz
fix incorrect access to tzname[] by strptime %Z conversion specifier
there are three issues here: 1. if tzset has not been called (explicitly or implicitly), the tzname[] array will contain null pointers, and the dereference to compare against them has undefined behavior (and will fault). 2. access to tzname[] was performed without the timezone lock held. this resulted in a data race if the timezone is concurrently changed from another thread. 3. due to unintended signedness of the types, the open-coded isalpha in the non-matching case was wrong and would continue past null termination. to fix the first two issues, the body of the %Z conversion is moved to __tz.c where it has access to locking, and null checks are added. there is probably an argument to be made that the equivalent of tzset should happen here, but POSIX does not specify that to happen, so in the absence of an interpretation adding such an allowance or requirement, it is not done. the third issue is fixed just by using the existing isalpha macro.
Diffstat (limited to 'src/thread/pthread_mutexattr_setpshared.c')
0 files changed, 0 insertions, 0 deletions