Author: marek Date: 2010-03-04 16:40:52 +0100 (Thu, 04 Mar 2010) New Revision: 1583
Modified: branches/batctl-0.2.x/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: branches/batctl-0.2.x/bat-hosts.c =================================================================== --- branches/batctl-0.2.x/bat-hosts.c 2010-03-04 15:33:24 UTC (rev 1582) +++ branches/batctl-0.2.x/bat-hosts.c 2010-03-04 15:40:52 UTC (rev 1583) @@ -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; }