Skip to content

If the buffer pointer is a null pointer then don't apply an offset to it#217

Merged
thiagomacieira merged 1 commit intointel:mainfrom
hamchapman:hc/no-offset-null-ptr
Apr 4, 2022
Merged

If the buffer pointer is a null pointer then don't apply an offset to it#217
thiagomacieira merged 1 commit intointel:mainfrom
hamchapman:hc/no-offset-null-ptr

Conversation

@hamchapman
Copy link
Contributor

This is undefined behaviour as caught by Xcode 13.2.1:

/Users/ham/TinyCborObjc/tinycbor/src/cborparser.c:1214:37: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/ham/TinyCborObjc/tinycbor/src/cborparser.c:1214:37 in 

Copy link
Member

@thiagomacieira thiagomacieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like pedantism for pedantism sake... but I'll accept this.

@thiagomacieira thiagomacieira merged commit 22c2980 into intel:main Apr 4, 2022
@thiagomacieira
Copy link
Member

Thank you for the contribution!

@hamchapman hamchapman deleted the hc/no-offset-null-ptr branch April 4, 2022 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants