Home GnuPG

cipher: Remove useless NULL check.
fbb97dcf763eUnpublished

Unpublished Commit · Learn More

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

Description

cipher: Remove useless NULL check.

* cipher/hash-common.c (_gcry_md_block_write): Remove NUL check for
hd->buf.

HD->BUF is not allocated but part of the struct. HD has already be
dereferenced twice thus the check does not make sense. Detected by
Stack 0.3:

bug: anti-simplify
model: |
  %cmp4 = icmp eq i8* %arraydecay, null, !dbg !29
  -->  false
stack:
  - /home/wk/s/libgcrypt/cipher/hash-common.c:114:0
ncore: 1
core:
  - /home/wk/s/libgcrypt/cipher/hash-common.c:108:0
    - null pointer dereference
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Mar 16 2015, 9:01 AM
Parents
rC5e66a4f8d5a6: Fix in-place encryption for OCB mode
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rCfbb97dcf763e: cipher: Remove useless NULL check. (authored by Werner Koch <wk@gnupg.org>).Mar 16 2015, 9:31 AM