Add ostensibly unnecessary null check

This commit is contained in:
Martin Vierula 2023-01-04 06:56:54 -08:00
parent 8038a529c0
commit 8b3b7a0e23
No known key found for this signature in database
GPG Key ID: F2FC4E45883BCBA4

View File

@ -1431,6 +1431,7 @@ static int var_multipart_part_headers_generate(modsec_rec *msr, msre_var *var, m
/* If we had a match add this argument to the collection. */
if (match) {
if (parts[i]->header_lines) { /* this NULL check shouldn't be necessary */
for (j = 0; j < parts[i]->header_lines->nelts; j++) {
char *header_line = ((char **)parts[i]->header_lines->elts)[j];
msre_var *rvar = apr_pmemdup(mptmp, var, sizeof(msre_var));
@ -1445,6 +1446,7 @@ static int var_multipart_part_headers_generate(modsec_rec *msr, msre_var *var, m
}
}
}
}
return count;
}