summaryrefslogtreecommitdiff
path: root/guile
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-10-09 22:31:39 +0200
committerLudovic Courtès <ludo@gnu.org>2013-10-09 22:31:39 +0200
commitf96534966c706c554238799306c50177d9eb2dc7 (patch)
tree44a6ba75c36906d741272a149dc1daef9caf919b /guile
parentdaad5b9ba054e17d8bcfb0b8c76d67dc19c64e0e (diff)
downloadgnutls-f96534966c706c554238799306c50177d9eb2dc7.tar.gz
guile: Fix possible stack overflows.
Diffstat (limited to 'guile')
-rw-r--r--guile/modules/gnutls/build/priorities.scm4
-rw-r--r--guile/src/core.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/guile/modules/gnutls/build/priorities.scm b/guile/modules/gnutls/build/priorities.scm
index 96aebfca71..4d14009308 100644
--- a/guile/modules/gnutls/build/priorities.scm
+++ b/guile/modules/gnutls/build/priorities.scm
@@ -1,5 +1,5 @@
;;; GnuTLS --- Guile bindings for GnuTLS.
-;;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
+;;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
;;;
;;; GnuTLS is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Lesser General Public
@@ -69,7 +69,7 @@
use `set-session-priorities!' instead\");~%" (enum-type-subsystem enum))
(format port " c_session = scm_to_gnutls_session (session, 1, FUNC_NAME);~%")
(format port " SCM_VALIDATE_LIST_COPYLEN (2, items, c_len);~%")
- (format port " c_items = alloca (sizeof (* c_items) * c_len);~%")
+ (format port " c_items = alloca (sizeof (* c_items) * (c_len + 1));~%")
(format port " for (i = 0; i < c_len; i++, items = SCM_CDR (items))~%")
(format port " c_items[i] = ~a (SCM_CAR (items), 2, FUNC_NAME);~%"
(enum-type-to-c-function enum))
diff --git a/guile/src/core.c b/guile/src/core.c
index ffd6608181..6940eae079 100644
--- a/guile/src/core.c
+++ b/guile/src/core.c
@@ -2086,7 +2086,7 @@ SCM_DEFINE (scm_gnutls_srp_base64_decode, "srp-base64-decode",
/* We assume that the decoded string is smaller than the encoded
string. */
c_result_len = c_str_len;
- c_result = alloca (c_result_len);
+ c_result = alloca (c_result_len + 1);
c_str_d.data = (unsigned char *) c_str;
c_str_d.size = c_str_len;