From 4254e90426a97afaed1af3f4caa01cc2f4021fb6 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 6 May 2008 14:03:36 +0000 Subject: Fixed bug#907. Fixed a segv in keybox and made it more robust. --- kbx/keybox-blob.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'kbx/keybox-blob.c') 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; -- cgit v1.2.3