mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Added null pointer check
This commit is contained in:
parent
3457fcbd55
commit
f162409851
@ -1241,6 +1241,10 @@ unsigned char *do_hash_link(modsec_rec *msr, char *link, int type) {
|
||||
char *relative_uri = NULL;
|
||||
|
||||
filename = file_basename(msr->mp, msr->r->parsed_uri.path);
|
||||
|
||||
if(filename == NULL || (strlen(msr->r->parsed_uri.path) - strlen(filename) < 0))
|
||||
return NULL;
|
||||
|
||||
relative_path = apr_pstrndup(msr->mp, msr->r->parsed_uri.path, strlen(msr->r->parsed_uri.path) - strlen(filename));
|
||||
relative_uri = apr_pstrcat(msr->mp, relative_path, link, NULL);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user