Commit 2273178
committed
Move deref to after non-null assert
Asserting afterwards triggers a GCC static analysis error:
source/sigv4.c:2413:5: warning: check of ‘pHmacContext_22(D)’ for NULL after already dereferencing it [-Wanalyzer-deref-before-check]
2413 | assert( pHmacContext != NULL );
| ^
‘hmacIntermediate’: events 1-2
|
| 2411 | const SigV4CryptoInterface_t * pCryptoInterface = pHmacContext->pCryptoInterface;
| | ^
| | |
| | (1) pointer ‘pHmacContext_22(D)’ is dereferenced here
| 2412 |
| 2413 | assert( pHmacContext != NULL );
| | ~
| | |
| | (2) pointer ‘pHmacContext_22(D)’ is checked for NULL here but it was already dereferenced at (1)
|1 parent 5b8dbdf commit 2273178
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2408 | 2408 | | |
2409 | 2409 | | |
2410 | 2410 | | |
2411 | | - | |
| 2411 | + | |
2412 | 2412 | | |
2413 | 2413 | | |
2414 | 2414 | | |
| |||
2417 | 2417 | | |
2418 | 2418 | | |
2419 | 2419 | | |
2420 | | - | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
2421 | 2423 | | |
2422 | 2424 | | |
2423 | 2425 | | |
| |||
0 commit comments