diff options
author | Alexey Izbyshev <izbyshev@ispras.ru> | 2022-10-07 15:23:57 +0300 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2022-10-19 14:01:32 -0400 |
commit | 26c76a908b8613ea8a77d40f3bd51b02f984501c (patch) | |
tree | 14c3b07590672b8554ca50f246fe7b55a0283829 /src/aio | |
parent | aebd6a36449e91c06763a40121d558b6cea90d50 (diff) | |
download | musl-26c76a908b8613ea8a77d40f3bd51b02f984501c.tar.gz musl-26c76a908b8613ea8a77d40f3bd51b02f984501c.tar.bz2 musl-26c76a908b8613ea8a77d40f3bd51b02f984501c.tar.xz musl-26c76a908b8613ea8a77d40f3bd51b02f984501c.zip |
fix use of uninitialized dummy_fut in aio_suspend
aio_suspend waits on a dummy futex in the corner case when the array of
requests contains NULL pointers only. But the value of this futex was
left uninitialized, so if it happens to be non-zero, aio_suspend
degrades to spinning instead of blocking.
Diffstat (limited to 'src/aio')
-rw-r--r-- | src/aio/aio_suspend.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/aio/aio_suspend.c b/src/aio/aio_suspend.c index 95def796..1f0c9aaa 100644 --- a/src/aio/aio_suspend.c +++ b/src/aio/aio_suspend.c @@ -9,7 +9,7 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec { int i, tid = 0, ret, expect = 0; struct timespec at; - volatile int dummy_fut, *pfut; + volatile int dummy_fut = 0, *pfut; int nzcnt = 0; const struct aiocb *cb = 0; |