[asterisk-bugs] [JIRA] (ASTERISK-30235) res_crypto and tests: Memory issues and and uninitialized variable error

Friendly Automation (JIRA) noreply at issues.asterisk.org
Mon Sep 19 10:07:10 CDT 2022


    [ https://issues.asterisk.org/jira/browse/ASTERISK-30235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=260257#comment-260257 ] 

Friendly Automation commented on ASTERISK-30235:
------------------------------------------------

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]

> 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: 20.0.0, 19.7.0, 18.15.0, 16.29.0
>            Reporter: George Joseph
>            Assignee: George Joseph
>
> 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