]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commit
Fix for a race condition in journal_write 1153/head
authorUmer Saleem <usaleem@ixsystems.com>
Thu, 20 Jan 2022 14:29:36 +0000 (19:29 +0500)
committerUmer Saleem <usaleem@ixsystems.com>
Thu, 20 Jan 2022 14:36:30 +0000 (19:36 +0500)
commitca9900e34d42123537655cb763367c550e071fc4
tree05d8480d3f63dc9c7e2d596f3e39376f7a2cb332
parentb43a0d8b435d0a6057d826bc6421a9121d4295dd
Fix for a race condition in journal_write

There is a race condition in journal_write() where journal_lock is
being acquired after checking whether journal_fh is NULL or not.
journal_fh is a static file handle that can be set to NULL by any
other thread, while current thread is blocked by
pthread_mutex_lock(). This commit fixes this race condition.

Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
src/rrd_daemon.c