Debian Codegraph @

gcc/testsuite/gcc.dg/analyzer/CVE-2005-1689-dedupe-issue.c

raw
1 /* { dg-additional-options "-fanalyzer-show-duplicate-count" } */
2
3 #include <stdlib.h>
4
5 typedef struct _krb5_data {
6 char *data;
7 } krb5_data;
8
9 /* Ensure that we de-duplicate the various paths to reach here,
10 and only emit one diagnostic. */
11
12 void
13 recvauth_common(krb5_data inbuf)
14 {
15 free(inbuf.data);
16 free(inbuf.data); /* { dg-warning "double-'free'" "warning" } */
17 /* { dg-message "2 duplicates" "duplicates notification" { xfail *-*-* } .-1 } */
18 }
19
20 void krb5_recvauth(krb5_data inbuf)
21 {
22 recvauth_common(inbuf);
23 }
24
25 void krb5_recvauth_version(krb5_data inbuf)
26 {
27 recvauth_common(inbuf);
28 }