Home GnuPG

Fix undefined behavior wrt memcpy
46c072669eb8Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Fix undefined behavior wrt memcpy

* cipher/cipher-gcm.c: Do not copy zero bytes from an empty buffer. Let
the function continue to add padding as needed though.
* cipher/mac-poly1305.c: If the caller requested to finish the hash
function without a copy of the result, return immediately.

Caught by UndefinedBehaviorSanitizer.

  • Signed-off-by: Peter Wu <peter@lekensteyn.nl>

Details

Provenance
LekensteynAuthored on Jul 26 2015, 3:50 PM
jukiviliCommitted on Jul 26 2015, 3:50 PM
Parents
rCada0a7d302cc: build: ignore scissor line for the commit-msg hook
Branches
Unknown
Tags
Unknown

Event Timeline

Jussi Kivilinna <jussi.kivilinna@iki.fi> committed rC46c072669eb8: Fix undefined behavior wrt memcpy (authored by Peter Wu <peter@lekensteyn.nl>).Jul 26 2015, 3:50 PM