]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Initialize bgp_notify.raw_data before passing to bgp_notify_receive()
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Sun, 31 Jan 2021 14:20:36 +0000 (16:20 +0200)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 16 Feb 2021 17:55:11 +0000 (20:55 +0300)
```
2523558-==2523558==
2523558-==2523558== Conditional jump or move depends on uninitialised value(s)
2523558:==2523558==    at 0x47F242: bgp_notify_admin_message (bgp_debug.c:505)
2523558-==2523558==    by 0x47F242: bgp_notify_print (bgp_debug.c:534)
2523558-==2523558==    by 0x4BA9BC: bgp_notify_receive (bgp_packet.c:1905)
2523558-==2523558==    by 0x4BA9BC: bgp_process_packet (bgp_packet.c:2602)
2523558-==2523558==    by 0x4904B7E: thread_call (thread.c:1681)
2523558-==2523558==    by 0x48CAA27: frr_run (libfrr.c:1126)
2523558-==2523558==    by 0x474B1A: main (bgp_main.c:540)
2523558-==2523558==  Uninitialised value was created by a stack allocation
2523558:==2523558==    at 0x4BA33D: bgp_process_packet (bgp_packet.c:2529)
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/bgp_packet.c

index f26c8a6a296ce27cb059e9e35d63adb93c2a1dd0..d4715c24337573a8b76cbdc1cf7d80c9e0f4dae1 100644 (file)
@@ -1806,6 +1806,7 @@ static int bgp_notify_receive(struct peer *peer, bgp_size_t size)
        bgp_notify.subcode = stream_getc(peer->curr);
        bgp_notify.length = size - 2;
        bgp_notify.data = NULL;
+       bgp_notify.raw_data = NULL;
 
        /* Preserv notify code and sub code. */
        peer->notify.code = bgp_notify.code;