Changeset 1581

Show
Ignore:
Timestamp:
03/04/10 16:33:20 (5 months ago)
Author:
marek
Message:

batctl: avoid buffer overflow when parsing bat-hosts file(s)

Reported-by: Marek Lindner <lindner_marek@…>
Signed-off-by: Sven Eckelmann <sven.eckelmann@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/batctl/bat-hosts.c

    r1565 r1581  
    8282                        continue; 
    8383 
    84                 if (sscanf(line_ptr, "%[^ \t]%s\n", mac_str, name) != 2) { 
     84                if (sscanf(line_ptr, "%17[^ \t]%49s\n", mac_str, name) != 2) { 
    8585                        fprintf(stderr, "Warning - unrecognized bat-host definition: %s", line_ptr); 
    8686                        continue;