[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8556: recent gnutls.c changes broke build on Ubuntu 10.10

From: Paul Eggert
Subject: bug#8556: recent gnutls.c changes broke build on Ubuntu 10.10
Date: Tue, 26 Apr 2011 00:18:16 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110223 Thunderbird/3.1.8

bzr 103998 introduced a bug in emacs_gnutls_handshake: it has
a 'return;' statement in a function returning an integer, which
violates the C standard.  I plan to fix this with the following
patch, for lack of a better idea, but it would be nice if someone
with more expertise in gnutls could double-check this.

* gnutls.c (emacs_gnutls_handshake): Always return a value.
Expect the caller to check whether GNUTLS_STAGE_HANDSHAKE_CANDO <=
proc->gnutls_initstage, if the check is needed.  The check isn't
needed for one caller, Fgnutls_boot.
(emacs_gnutls_read): Do that check.  This is the other caller.
=== modified file 'src/gnutls.c'
--- src/gnutls.c        2011-04-26 06:17:52 +0000
+++ src/gnutls.c        2011-04-26 07:05:42 +0000
@@ -73,9 +73,6 @@
   gnutls_session_t state = proc->gnutls_state;
   int ret;

-  if (proc->gnutls_initstage < GNUTLS_STAGE_HANDSHAKE_CANDO)
-    return;
   if (proc->gnutls_initstage < GNUTLS_STAGE_TRANSPORT_POINTERS_SET)
@@ -179,7 +176,8 @@

   if (proc->gnutls_initstage != GNUTLS_STAGE_READY)
-      emacs_gnutls_handshake (proc);
+      if (GNUTLS_STAGE_HANDSHAKE_CANDO <= proc->gnutls_initstage)
+       emacs_gnutls_handshake (proc);
       return -1;
   rtnval = gnutls_read (state, buf, nbyte);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]