Re: [PATCH for-4.17 v3 14/15] tools/ocaml/xenstored/syslog_stubs.c: avoid potential NULL dereference

2022-11-09 Thread Christian Lindig
On 8 Nov 2022, at 15:34, Edwin Török mailto:edvin.to...@citrix.com>> wrote: If we are out of memory then strdup may return NULL, and passing NULL to syslog may cause a crash. Avoid this by using `caml_stat_strdup` which will raise an OCaml out of memory exception instead. This then needs to be

Re: [PATCH for-4.17 v3 14/15] tools/ocaml/xenstored/syslog_stubs.c: avoid potential NULL dereference

2022-11-08 Thread Edwin Torok
> On 8 Nov 2022, at 16:07, Julien Grall wrote: > > > > On 08/11/2022 15:34, Edwin Török wrote: >> If we are out of memory then strdup may return NULL, and passing NULL to >> syslog may cause a crash. >> Avoid this by using `caml_stat_strdup` which will raise an OCaml out of >> memory exceptio

Re: [PATCH for-4.17 v3 14/15] tools/ocaml/xenstored/syslog_stubs.c: avoid potential NULL dereference

2022-11-08 Thread Julien Grall
On 08/11/2022 15:34, Edwin Török wrote: If we are out of memory then strdup may return NULL, and passing NULL to syslog may cause a crash. Avoid this by using `caml_stat_strdup` which will raise an OCaml out of memory exception instead. This then needs to be paired with caml_stat_free. Signe

[PATCH for-4.17 v3 14/15] tools/ocaml/xenstored/syslog_stubs.c: avoid potential NULL dereference

2022-11-08 Thread Edwin Török
If we are out of memory then strdup may return NULL, and passing NULL to syslog may cause a crash. Avoid this by using `caml_stat_strdup` which will raise an OCaml out of memory exception instead. This then needs to be paired with caml_stat_free. Signed-off-by: Edwin Török --- Reason for inclusi