]> granicus.if.org Git - strace/commitdiff
tests/bpf.c: add a check for NULL bpf_attr pointer
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 21 Mar 2018 18:09:52 +0000 (19:09 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 1 Apr 2018 13:14:15 +0000 (13:14 +0000)
* tests/bpf.c (main): Add a check with 0 passed in the third argument.

tests/bpf.c

index 13a6b11cc2312f66e076449cbd297e3c06b6ff55..42d21d9754c32ea132c6c929ef706cc58f75fc14 100644 (file)
@@ -743,6 +743,10 @@ main(void)
        TEST_BPF(BPF_OBJ_GET_INFO_BY_FD);
 # endif
 
+       sys_bpf(0xfacefeed, 0, (kernel_ulong_t) 0xfacefeedbadc0dedULL);
+       printf("bpf(0xfacefeed /* BPF_??? */, NULL, %u) = %s\n",
+              0xbadc0dedu, errstr);
+
        sys_bpf(0xfacefeed, end_of_page, 40);
        printf("bpf(0xfacefeed /* BPF_??? */, %#lx, 40) = %s\n",
               end_of_page, errstr);