]> The Tcpdump Group git mirrors - libpcap/commitdiff
fix use of sizeof on a pointer 786/head
authorAlexander Galanin <[email protected]>
Mon, 3 Dec 2018 13:12:48 +0000 (16:12 +0300)
committerAlexander Galanin <[email protected]>
Mon, 3 Dec 2018 13:12:48 +0000 (16:12 +0300)
pcap-bpf.c

index 3b5397826157f8794935e4fe585518676f9d6618..13c1cf27027c2dbc09773b6b6b1bdab266266b30 100644 (file)
@@ -1366,8 +1366,8 @@ bpf_load(char *errbuf)
 
        /* Check if the driver is loaded */
        memset(&cfg_ld, 0x0, sizeof(cfg_ld));
+       pcap_snprintf(buf, sizeof(buf), "%s/%s", DRIVER_PATH, BPF_NAME);
        cfg_ld.path = buf;
-       pcap_snprintf(cfg_ld.path, sizeof(cfg_ld.path), "%s/%s", DRIVER_PATH, BPF_NAME);
        if ((sysconfig(SYS_QUERYLOAD, (void *)&cfg_ld, sizeof(cfg_ld)) == -1) ||
            (cfg_ld.kmid == 0)) {
                /* Driver isn't loaded, load it now */