Fix: elf: NULL pointer dereference
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 4 Sep 2015 05:35:47 +0000 (01:35 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 4 Sep 2015 05:35:47 +0000 (01:35 -0400)
Coverity reported:
CID 1321730 (#1 of 1): Dereference null return value (NULL_RETURNS)15.
dereference: Dereferencing a pointer that might be null _build_id when
calling lttng_ust_read.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-elf.c

index ee7eb7c4d2020b31adaeeb4c12dd460c16557a6a..dd50f2b674d689d2be9831536790e064765b8164 100644 (file)
@@ -452,7 +452,7 @@ int lttng_ust_elf_get_build_id_from_segment(
 
                _length = nhdr.n_descsz;
                _build_id = zmalloc(sizeof(uint8_t) * _length);
-               if (!build_id) {
+               if (!_build_id) {
                        goto error;
                }
 
This page took 0.025925 seconds and 4 git commands to generate.