summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2007-08-27 15:59:51 +0200
committerSimon Josefsson <simon@josefsson.org>2007-08-27 15:59:51 +0200
commitfc9a8c420d86c226442f4f8c8cb9b6f4e29e47f2 (patch)
treeb490694d8f05ae7a8661991e286cf7671a74c0d2 /lib
parent9949a4b0b6b62a0ff3c05fee4283928d1a53b675 (diff)
downloadgnutls-fc9a8c420d86c226442f4f8c8cb9b6f4e29e47f2.tar.gz
Have gnutls_error_is_fatal return 0 on positive "errors".
Would fix bug reported by Andreas Metzler <ametzler@downhill.at.eu.org> in <http://permalink.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/2293 see also <http://bugs.debian.org/439640>.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls_errors.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gnutls_errors.c b/lib/gnutls_errors.c
index 0e28275cf3..150e23adb5 100644
--- a/lib/gnutls_errors.c
+++ b/lib/gnutls_errors.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+ * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
*
* Author: Nikos Mavroyanopoulos
*
@@ -271,7 +271,13 @@ gnutls_error_is_fatal (int error)
{
int ret = 1;
+ /* Input sanitzation. Positive values are not errors at all, and
+ definitely not fatal. */
+ if (error > 0)
+ return 0;
+
GNUTLS_ERROR_ALG_LOOP (ret = p->fatal);
+
return ret;
}