diff options
author | Werner Koch <[email protected]> | 2008-05-06 14:03:36 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2008-05-06 14:03:36 +0000 |
commit | 4254e90426a97afaed1af3f4caa01cc2f4021fb6 (patch) | |
tree | 82e0123ba381605484c332038504dae8e967b2e7 /kbx/keybox-search.c | |
parent | add gpg-zip man page. (diff) | |
download | gnupg-4254e90426a97afaed1af3f4caa01cc2f4021fb6.tar.gz gnupg-4254e90426a97afaed1af3f4caa01cc2f4021fb6.zip |
Fixed bug#907.
Fixed a segv in keybox and made it more robust.
Diffstat (limited to 'kbx/keybox-search.c')
-rw-r--r-- | kbx/keybox-search.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kbx/keybox-search.c b/kbx/keybox-search.c index fc397c7ed..153186b4f 100644 --- a/kbx/keybox-search.c +++ b/kbx/keybox-search.c @@ -735,7 +735,7 @@ keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc) { sn_array = xtrycalloc (ndesc, sizeof *sn_array); if (!sn_array) - return (hd->error = gpg_error (gpg_err_code_from_errno (errno))); + return (hd->error = gpg_error_from_syserror ()); } } @@ -744,7 +744,7 @@ keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc) hd->fp = fopen (hd->kb->fname, "rb"); if (!hd->fp) { - hd->error = gpg_error (gpg_err_code_from_errno (errno)); + hd->error = gpg_error_from_syserror (); xfree (sn_array); return hd->error; } @@ -776,7 +776,7 @@ keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc) sn_array[n].sn = xtrymalloc (snlen); if (!sn_array[n].sn) { - hd->error = gpg_error (gpg_err_code_from_errno (errno)); + hd->error = gpg_error_from_syserror (); release_sn_array (sn_array, n); return hd->error; } @@ -800,7 +800,7 @@ keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc) sn_array[n].sn = xtrymalloc (snlen); if (!sn_array[n].sn) { - hd->error = gpg_error (gpg_err_code_from_errno (errno)); + hd->error = gpg_error_from_syserror (); release_sn_array (sn_array, n); return hd->error; } |