giterr format by pks-t · Pull Request #4002 · libgit2/libgit2 · GitHub
Skip to content

giterr format#4002

Merged
carlosmn merged 5 commits into
libgit2:masterfrom
pks-t:pks/giterr-format
Nov 14, 2016
Merged

giterr format#4002
carlosmn merged 5 commits into
libgit2:masterfrom
pks-t:pks/giterr-format

Conversation

@pks-t

@pks-t pks-t commented Nov 14, 2016

Copy link
Copy Markdown
Member

While inspecting #4000, I've been very surprised to find out that we were passing a git_buf pointer to giterr_set without any warning of the compiler. Seems we didn't put a printf-attribute hint at the declaration, causing the compiler to accept whatever we put there.

Next to the many cases of "%d" instead of "%"PRIuZ which can cause us to overflow in the output, there were also three real errors where we passed a structure pointer to "%s" instead of the real value.

@carlosmn

Copy link
Copy Markdown
Member

@carlosmn carlosmn merged commit e1c1433 into libgit2:master Nov 14, 2016
@ethomson

Copy link
Copy Markdown
Member

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.

3 participants