]> xenbits.xensource.com Git - xen.git/commit
tools/oxenstored/syslog: Avoid potential NULL dereference
authorEdwin Török <edvin.torok@citrix.com>
Tue, 8 Nov 2022 14:24:19 +0000 (14:24 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 12 Dec 2022 11:04:12 +0000 (11:04 +0000)
commit4a8ff8bf1b32b4ff3ac8c472f0d861aa866a0fcf
tree6e685586d64ea7956baf54e54333f26342e0ad03
parenta41d9693539676e8b4a4d2cef46db492e24b94a0
tools/oxenstored/syslog: Avoid potential NULL dereference

strdup() may return NULL.  Check for this before passing to syslog().

Drop const from c_msg.  It is bogus, as demonstrated by the need to cast to
void * in order to free the memory.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
(cherry picked from commit acd3fb6d65905f8a185dcb9fe6a330a591b96203)
tools/ocaml/xenstored/syslog_stubs.c