diff options
author | Andre Heinecke <[email protected]> | 2023-10-28 12:20:31 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2023-10-28 12:20:31 +0000 |
commit | 05ef8c0cc005fcdf412be6819428c677f0185d33 (patch) | |
tree | c67653e8c3190e7592d08803369cbdb070ee94e0 /g10/sign.c | |
parent | Minor style fixes. (diff) | |
download | gnupg-05ef8c0cc005fcdf412be6819428c677f0185d33.tar.gz gnupg-05ef8c0cc005fcdf412be6819428c677f0185d33.zip |
g10: Fix uninitalized variable use in sign_file
* g10/sign.c (sign_file): Initialize gcry_md_hd_t to NULL.
--
There are several jumps to leave before gcry_md_open is called so
md should be initialized to NULL to avoid calling gcry_md_close
on an uninitalized variable.
GnuPG-Bug-Id: T6780
Diffstat (limited to 'g10/sign.c')
-rw-r--r-- | g10/sign.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/g10/sign.c b/g10/sign.c index f68ea3bc7..ee3fac1df 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -1020,7 +1020,7 @@ sign_file (ctrl_t ctrl, strlist_t filenames, int detached, strlist_t locusr, const char *fname; armor_filter_context_t *afx; compress_filter_context_t zfx; - gcry_md_hd_t md; + gcry_md_hd_t md = NULL; md_filter_context_t mfx; md_thd_filter_context_t mfx2 = NULL; text_filter_context_t tfx; |