mirror of https://github.com/asterisk/asterisk
app_voicemail_odbc: fix msgnum race and crash on failed STORE Two concurrent callers leaving voicemail to the same mailbox could be assigned the same msgnum because ast_unlock_path() was called before STORE(), allowing a second thread to read the same LAST_MSG_INDEX() before the first INSERT committed. The losing thread got a duplicate key error, but execution continued into notify_new_message() -> RETRIEVE() because the STORE() return value was not checked. RETRIEVE() then fetched the winning thread's DB row, mmap'd its blob size against the locally truncated file, and crashed with SIGBUS. Hold the path lock through STORE() and bail out on failure. Fixes: #1653pull/1911/head
parent
f7b60322b1
commit
9e5f769e80
Loading…
Reference in new issue