foobomb()
{
printf("Uhoh... getpwnam() died.\n");
exit();
}
main()
{
char buf[20000];
struct passwd *pw;
memset(buf,'a',19990);
signal(SIGBUS,foobomb);
pw=getpwnam(buf);
signal(SIGBUS,SIG_IGN);
if (!pw)
{
printf("Success, no user was found.\n");
}
else
{
printf("What the... a user was found?\n");
printf(" user: %.100s\n",pw->pw_name);
}
}
-----------------------------------------------------------------------------
-- Charles Howes -- chowes@ics.bc.ca