Actions
Bug #15488
openlibbsm: storing the address of local variable
Start date:
Due date:
% Done:
90%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
Description
Build error with gcc 12:
../common/audit_crontab.c: In function 'audit_crontab_get_diffs': ../common/audit_crontab.c:218:25: error: storing the address of local variable 'err_buf' in '*bufptr' [-Werror=dangling-pointer=] 218 | *bufptr = err_buf; | ~~~~~~~~^~~~~~~~~ ../common/audit_crontab.c:172:30: note: 'err_buf' declared here 172 | char *buf = NULL, err_buf[128]; | ^~~~~~~ ../common/audit_crontab.c:172:30: note: 'bufptr' declared here
The first idea is to change this buffer to static.
Actions