Fix segfault in netledPi

Device names in Raspbian Stretch can apparently be longer than 8 characters, causing a segmentation fault because the array that holds them is too short. Increased the array to 32 chars.
https://github.com/RagnarJensen/PiLEDlights/issues/1#event-1252022972
This commit is contained in:
Ragnar Jensen 2017-09-17 10:28:08 +02:00 committed by GitHub
parent b88a415bbf
commit edce1404b8

View File

@ -80,7 +80,7 @@ int activity(FILE *netdevices) {
int found_inpackets, found_outpackets; int found_inpackets, found_outpackets;
int result; int result;
char *ptr; char *ptr;
char device[8]; char device[32];
/* Go to the beginning of the netdevices file */ /* Go to the beginning of the netdevices file */
result = TEMP_FAILURE_RETRY(fseek(netdevices, 0L, SEEK_SET)); result = TEMP_FAILURE_RETRY(fseek(netdevices, 0L, SEEK_SET));