Commit 4aa1720
committed
agent: do not store stack pointer in transaction context
Fixing:
```
src/agent.c:956:9: warning: Address of stack memory associated with local variable 'c' is still referred to by the caller variable 'agent' upon returning to the caller. This will be a dangling reference [clang-analyzer-core.StackAddressEscape]
956 | return _libssh2_error(agent->session, LIBSSH2_ERROR_BAD_USE,
| ^
src/agent.c:1164:12: note: Calling 'agent_list_identities'
1164 | return agent_list_identities(agent);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/agent.c:942:8: note: Assuming field 'state' is equal to agent_NB_state_init
942 | if(transctx->state == agent_NB_state_init) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/agent.c:942:5: note: Taking true branch
942 | if(transctx->state == agent_NB_state_init) {
| ^
src/agent.c:950:5: note: Taking false branch
950 | if(*transctx->request != SSH2_AGENTC_REQUEST_IDENTITIES)
| ^
src/agent.c:954:8: note: Assuming field 'ops' is null
954 | if(!agent->ops)
| ^~~~~~~~~~~
src/agent.c:954:5: note: Taking true branch
954 | if(!agent->ops)
| ^
```
Closes libssh2#18451 parent 3d4ff6b commit 4aa1720
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | | - | |
| 937 | + | |
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
941 | | - | |
| 941 | + | |
942 | 942 | | |
943 | 943 | | |
944 | 944 | | |
| |||
0 commit comments