mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Improves #927 by checking earlier if the string is empty or not
This commit is contained in:
parent
7ba07bd547
commit
198032208a
@ -626,8 +626,10 @@ int collections_remove_stale(modsec_rec *msr, const char *col_name) {
|
||||
*/
|
||||
rc = apr_sdbm_firstkey(dbm, &key);
|
||||
while(rc == APR_SUCCESS) {
|
||||
char *s = apr_pstrmemdup(msr->mp, key.dptr, strlen(key.dptr));
|
||||
*(char **)apr_array_push(keys_arr) = s;
|
||||
if (key.dsize) {
|
||||
char *s = apr_pstrmemdup(msr->mp, key.dptr, key.dsize - 1);
|
||||
*(char **)apr_array_push(keys_arr) = s;
|
||||
}
|
||||
rc = apr_sdbm_nextkey(dbm, &key);
|
||||
}
|
||||
apr_sdbm_unlock(dbm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user