Summary: | ASTERISK-30235: res_crypto and tests: Memory issues and and uninitialized variable error | ||
Reporter: | George Joseph (gjoseph) | Labels: | |
Date Opened: | 2022-09-16 09:54:56 | Date Closed: | 2022-09-19 08:06:39 |
Priority: | Minor | Regression? | |
Status: | Closed/Complete | Components: | Resources/res_crypto |
Versions: | 16.29.0 18.15.0 19.7.0 20.0.0 | Frequency of Occurrence | |
Related Issues: | |||
Environment: | Attachments: | ||
Description: | When compiled with optimization...
{code} test_crypto.c: In function ‘hexstring.constprop’: test_crypto.c:60:16: error: function returns address of local variable [-Werror=return-local-addr] 60 | return buf; | ^~~ In file included from /usr/include/stdlib.h:574, from /usr/src/asterisk/asterisk/include/asterisk/compat.h:41, from /usr/src/asterisk/asterisk/include/asterisk.h:22, from test_crypto.c:33: test_crypto.c:52:21: note: declared here 52 | char *buf = alloca(datalen * 2 + 1); test.c: In function ‘ast_test_capture_command’: test.c:114:15: error: ‘out’ may be used uninitialized [-Werror=maybe-uninitialized] 114 | ({ if (fp != NULL) { \ | ^ test.c:382:36: note: ‘out’ was declared here 382 | FILE *cmd = NULL, *out = NULL, *err = NULL; | ^~~ {code} In res_crypto try_load_key(), the returned "buf" is never freed. | ||
Comments: | By: Friendly Automation (friendly-automation) 2022-09-19 08:06:40.241-0500 Change 19269 merged by Friendly Automation: res_crypto: Memory issues and uninitialized variable errors [https://gerrit.asterisk.org/c/asterisk/+/19269|https://gerrit.asterisk.org/c/asterisk/+/19269] By: Friendly Automation (friendly-automation) 2022-09-19 10:05:13.499-0500 Change 19267 merged by Friendly Automation: res_crypto: Memory issues and uninitialized variable errors [https://gerrit.asterisk.org/c/asterisk/+/19267|https://gerrit.asterisk.org/c/asterisk/+/19267] By: Friendly Automation (friendly-automation) 2022-09-19 10:05:21.097-0500 Change 19271 merged by Friendly Automation: res_crypto: Memory issues and uninitialized variable errors [https://gerrit.asterisk.org/c/asterisk/+/19271|https://gerrit.asterisk.org/c/asterisk/+/19271] By: Friendly Automation (friendly-automation) 2022-09-19 10:05:25.807-0500 Change 19275 merged by Friendly Automation: res_crypto: Memory issues and uninitialized variable errors [https://gerrit.asterisk.org/c/asterisk/+/19275|https://gerrit.asterisk.org/c/asterisk/+/19275] By: Friendly Automation (friendly-automation) 2022-09-19 10:05:31.766-0500 Change 19268 merged by Friendly Automation: res_crypto: Memory issues and uninitialized variable errors [https://gerrit.asterisk.org/c/asterisk/+/19268|https://gerrit.asterisk.org/c/asterisk/+/19268] By: Friendly Automation (friendly-automation) 2022-09-19 10:05:35.131-0500 Change 19272 merged by Friendly Automation: res_crypto: Memory issues and uninitialized variable errors [https://gerrit.asterisk.org/c/asterisk/+/19272|https://gerrit.asterisk.org/c/asterisk/+/19272] By: Friendly Automation (friendly-automation) 2022-09-19 10:05:41.740-0500 Change 19270 merged by Friendly Automation: res_crypto: Memory issues and uninitialized variable errors [https://gerrit.asterisk.org/c/asterisk/+/19270|https://gerrit.asterisk.org/c/asterisk/+/19270] By: Friendly Automation (friendly-automation) 2022-09-19 10:05:46.127-0500 Change 19274 merged by Friendly Automation: res_crypto: Memory issues and uninitialized variable errors [https://gerrit.asterisk.org/c/asterisk/+/19274|https://gerrit.asterisk.org/c/asterisk/+/19274] By: Friendly Automation (friendly-automation) 2022-09-19 10:05:50.160-0500 Change 19273 merged by Friendly Automation: res_crypto: Memory issues and uninitialized variable errors [https://gerrit.asterisk.org/c/asterisk/+/19273|https://gerrit.asterisk.org/c/asterisk/+/19273] |