Skip to content

Commit

Permalink
Add assertion to ensure pBufCur points to the same array
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Mar 4, 2024
1 parent cc19e53 commit dc5061d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/sigv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -3293,6 +3293,8 @@ SigV4Status_t SigV4_GenerateHTTPAuthorization( const SigV4Parameters_t * pParams
* Note that the StringToSign starts from the beginning of the processing buffer. */
if( returnStatus == SigV4Success )
{
assert( canonicalContext.pBufCur >= ( char * ) ( canonicalContext.pBufProcessing ) );
assert( canonicalContext.pBufCur <= ( char * ) ( &( canonicalContext.pBufProcessing[ SIGV4_PROCESSING_BUFFER_LENGTH - 1 ] ) ) );
/* MISRA Ref 18.2.1 [Pointer subtraction within array] */
/* More details at: https://github.com/aws/SigV4-for-AWS-IoT-embedded-sdk/blob/main/MISRA.md#rule-182 */
/* coverity[misra_c_2012_rule_18_2_violation] */
Expand Down

0 comments on commit dc5061d

Please sign in to comment.