sunrpc: Test case for clnt_create "unix" buffer overflow (bug 22542)
[glibc.git] / elf / next.c
bloba0d532b8c332a74286d920b7f835e2ee9252a4a7
1 #include <stdio.h>
4 extern int successful_rtld_next_test (void);
5 extern void *failing_rtld_next_use (void);
8 static int
9 do_test (void)
11 int result;
12 void *addr;
14 /* First try call a function which uses RTLD_NEXT and calls that
15 function. */
16 result = successful_rtld_next_test ();
17 if (result == 42)
19 puts ("RTLD_NEXT seems to work for existing functions");
20 result = 0;
22 else
24 printf ("Heh? `successful_rtld_next_test' returned %d\n", result);
25 result = 1;
28 /* Next try a function which tries to get a function with RTLD_NEXT
29 but that fails. This dlsym() call should return a NULL pointer
30 and do nothing else. */
31 addr = failing_rtld_next_use ();
32 if (addr == NULL)
33 puts ("dlsym returned NULL for non-existing function. Good");
34 else
36 puts ("dlsym found something !?");
37 result = 1;
40 return result;
43 #include <support/test-driver.c>