Merge remote-tracking branch 'origin/NR_undefined_behavior_fixes' into integration_2023_w22

This commit is contained in:
Robert Schmidt
2023-06-02 13:27:24 +02:00
8 changed files with 31 additions and 41 deletions
+3 -3
View File
@@ -220,9 +220,9 @@ uint8_t pulls16(uint8_t **in, int16_t *out, uint8_t *end) {
uint8_t pull32(uint8_t **in, uint32_t *out, uint8_t *end) {
uint8_t *pIn = *in;
if((end - pIn) >=4 ) {
*out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
(*in)+=4;
if((end - pIn) >= 4) {
*out = ((uint32_t)pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
(*in) += 4;
return 4;
} else {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);