Skip to content

Commit fd20e52

Browse files
committed
Specify size of the buffer in fscanf
The terminating null byte is not included in the length.
1 parent 8ded458 commit fd20e52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/OVAL/probes/unix/linux/iflisteners.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int get_interface(const int ent_ifindex, struct interface_t *interface) {
353353
*(interface->hw_address) = '\0';
354354
}
355355
else {
356-
if (fscanf(fd, "%s\n", buf) < 1)
356+
if (fscanf(fd, "%254s\n", buf) < 1)
357357
*buf = '\0';
358358

359359
snprintf(interface->hw_address, sizeof interface->hw_address, "%s", buf);

0 commit comments

Comments
 (0)