Fix: client_sequence_number may dereference NULL pointer
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 4 Jun 2019 18:36:44 +0000 (14:36 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 4 Jun 2019 18:37:52 +0000 (14:37 -0400)
Found by Coverity:
CID 1400710 (#1 of 1): Dereference null return value (NULL_RETURNS)
3. dereference: Dereferencing a null pointer header.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ring-buffer-client.h

index 55209f45236db21b3700f8ddac0179430780eec8..b5eb692f7574db223ef2b06e3047277dd56274ce 100644 (file)
@@ -583,6 +583,8 @@ static int client_sequence_number(struct lttng_ust_lib_ring_buffer *buf,
        struct packet_header *header;
 
        header = client_packet_header(buf, handle);
+       if (!header)
+               return -1;
        *seq = header->ctx.packet_seq_num;
        return 0;
 }
This page took 0.025406 seconds and 4 git commands to generate.