You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In apache2/persist_dbm.c, in collection_store(), we have the following declaration:
char *username;
The variable is supposed to be initialized on line 392:
apr_uid_name_get(&username, uid, msr->mp);
In case there's a problem in apr_uid_name_get(), the variable is not initialized. This leads to a crash on line 412:
dbm_filename = apr_pstrcat(msr->, "/", username, ...
If username is initialized to a static empty string, no more crash.
char *username = "";
We could also check apr_uid_name_get() return code and initialize username only in case of error but this would be less efficient and add useless code.
No idea why the function apr_uid_name_get() fails in my environment, but this can be reproduced easily in a debugger.
The fix is anyway safe and aligned with good practices.
The text was updated successfully, but these errors were encountered:
In apache2/persist_dbm.c, in collection_store(), we have the following declaration:
char *username;
The variable is supposed to be initialized on line 392:
apr_uid_name_get(&username, uid, msr->mp);
In case there's a problem in apr_uid_name_get(), the variable is not initialized. This leads to a crash on line 412:
dbm_filename = apr_pstrcat(msr->, "/", username, ...
If username is initialized to a static empty string, no more crash.
char *username = "";
We could also check apr_uid_name_get() return code and initialize username only in case of error but this would be less efficient and add useless code.
No idea why the function apr_uid_name_get() fails in my environment, but this can be reproduced easily in a debugger.
The fix is anyway safe and aligned with good practices.
The text was updated successfully, but these errors were encountered: