Author: marek Date: 2010-03-04 16:33:20 +0100 (Thu, 04 Mar 2010) New Revision: 1581
Modified: trunk/batctl/bat-hosts.c Log: batctl: avoid buffer overflow when parsing bat-hosts file(s)
Reported-by: Marek Lindner lindner_marek@yahoo.de Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de
Modified: trunk/batctl/bat-hosts.c =================================================================== --- trunk/batctl/bat-hosts.c 2010-03-04 13:13:06 UTC (rev 1580) +++ trunk/batctl/bat-hosts.c 2010-03-04 15:33:20 UTC (rev 1581) @@ -81,7 +81,7 @@ if ((line_ptr[0] == '\n') || (line_ptr[0] == '#')) continue;
- if (sscanf(line_ptr, "%[^ \t]%s\n", mac_str, name) != 2) { + if (sscanf(line_ptr, "%17[^ \t]%49s\n", mac_str, name) != 2) { fprintf(stderr, "Warning - unrecognized bat-host definition: %s", line_ptr); continue; }