Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
daemon: fix off-by-one in MSG_TRIGGER_SERVICE3 validation
The handle_message_from_agent() assumes there is always a space for terminating NUL character in the payload. Reject messages that has 0 space for the payload, as that would make the function write NUL byte before the malloc()-ed buffer, and then proceed to handle it as NUL-terminated string (which isn't necessarily the case now). In practice, glibc's malloc() always allocate at least 32 bytes buffer, even if 0 was requested, and the later call to sanitize_name() will hit some NUL byte in those 32 bytes before corrupting anything (see more detailed analysis in QSB-089), but some more serious impact cannot be fully excluded. Reported-by: Demi Marie Obenour <[email protected]> (cherry picked from commit 322bcf6)
- Loading branch information