[asterisk-bugs] [JIRA] (ASTERISK-30235) res_crypto and tests: Memory issues and and uninitialized variable error
Asterisk Team (JIRA)
noreply at issues.asterisk.org
Thu Dec 15 07:09:56 CST 2022
[ https://issues.asterisk.org/jira/browse/ASTERISK-30235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Asterisk Team updated ASTERISK-30235:
-------------------------------------
Target Release Version/s: 20.1.0
> res_crypto and tests: Memory issues and and uninitialized variable error
> -------------------------------------------------------------------------
>
> Key: ASTERISK-30235
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-30235
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Resources/res_crypto
> Affects Versions: 16.29.0, 18.15.0, 19.7.0, 20.0.0
> Reporter: George Joseph
> Assignee: George Joseph
> Target Release: 16.29.0, 18.15.0, 19.7.0, 20.0.0, 16.30.0, 19.8.0, 20.1.0
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list