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-blob.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-blob.c')
-rw-r--r-- | kbx/keybox-blob.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kbx/keybox-blob.c b/kbx/keybox-blob.c index a45c42167..6f89a43f9 100644 --- a/kbx/keybox-blob.c +++ b/kbx/keybox-blob.c @@ -685,7 +685,7 @@ create_blob_finish (KEYBOXBLOB blob) pp = xtrymalloc (n); if ( !pp ) - return gpg_error (gpg_err_code_from_errno (errno)); + return gpg_error_from_syserror (); memcpy (pp , p, n); blob->blob = pp; blob->bloblen = n; @@ -706,7 +706,7 @@ _keybox_create_pgp_blob (KEYBOXBLOB *r_blob, KBNODE keyblock, int as_ephemeral) *r_blob = NULL; blob = xtrycalloc (1, sizeof *blob); if (!blob) - return gpg_error (gpg_err_code_from_errno (errno)); + return gpg_error_from_syserror (); /* fixme: Do some sanity checks on the keyblock */ @@ -838,7 +838,7 @@ _keybox_create_x509_blob (KEYBOXBLOB *r_blob, ksba_cert_t cert, *r_blob = NULL; blob = xtrycalloc (1, sizeof *blob); if( !blob ) - return gpg_error (gpg_err_code_from_errno (errno)); + return gpg_error_from_syserror (); sn = ksba_cert_get_serial (cert); if (sn) @@ -873,7 +873,7 @@ _keybox_create_x509_blob (KEYBOXBLOB *r_blob, ksba_cert_t cert, names = xtrymalloc (max_names * sizeof *names); if (!names) { - rc = gpg_error (gpg_err_code_from_errno (errno)); + rc = gpg_error_from_syserror (); goto leave; } @@ -894,7 +894,7 @@ _keybox_create_x509_blob (KEYBOXBLOB *r_blob, ksba_cert_t cert, tmp = xtryrealloc (names, max_names * sizeof *names); if (!tmp) { - rc = gpg_error (gpg_err_code_from_errno (errno)); + rc = gpg_error_from_syserror (); goto leave; } } @@ -985,7 +985,7 @@ _keybox_new_blob (KEYBOXBLOB *r_blob, *r_blob = NULL; blob = xtrycalloc (1, sizeof *blob); if (!blob) - return gpg_error (gpg_err_code_from_errno (errno)); + return gpg_error_from_syserror (); blob->blob = image; blob->bloblen = imagelen; |