Thursday, September 2, 2010

plan9 gethostbyname off-by-one :)

struct servent*
getservbyname(char *name, char *proto)
{
...
static char buf[1024];
...
/* construct the query, always expect an ip# back */
if(num)
snprintf(buf, sizeof buf, "!port=%s %s=*", name, proto);
else
snprintf(buf, sizeof buf, "!%s=%s port=*", proto, name);
...
}

hali hazirda plan9 isletim sistemi olanlar deneyip teyit edebilir ben denemedim sadece Google'da rastladım bir blogdan :)

http://plan9.bell-labs.com/sources/plan9/sys/src/ape/lib/bsd/getservbyname.c

@HellCode Research: "plan9'la ugrasiyordunuz bir goz atarmisiniz :)"

No comments:

Post a Comment