bpf: work around scan-build warning

suricata.c:574:5: warning: Potential out of bound access to the heap area with tainted index [security.ArrayBound]
  574 |     bpf_filter[nm] = '\0';
      |     ^~~~~~~~~~~~~~
1 warning generated.
pull/15429/head
Victor Julien 4 months ago
parent 06dcb5aeb0
commit dc6696ac04

@ -583,6 +583,7 @@ static void SetBpfStringFromFile(char *filename)
exit(EXIT_FAILURE);
}
fclose(fp);
DEBUG_VALIDATE_BUG_ON(nm >= bpf_len); // help scan-build
bpf_filter[nm] = '\0';
if(strlen(bpf_filter) > 0) {

Loading…
Cancel
Save