fix #6184
authorChristian Grothoff <christian@grothoff.org>
Wed, 15 Apr 2020 18:26:00 +0000 (20:26 +0200)
committerChristian Grothoff <christian@grothoff.org>
Wed, 15 Apr 2020 18:26:00 +0000 (20:26 +0200)
src/gns/gnunet-gns-proxy.c
src/include/gnunet_json_lib.h

index c0572fe4065ec53ead445cc41e36b7da6561f0e8..956faf9838d0eafd4277337251749bb6fea4848f 100644 (file)
@@ -3012,6 +3012,9 @@ signal_socks_failure (struct Socks5Request *s5r,
 {
   struct Socks5ServerResponseMessage *s_resp;
 
+  GNUNET_break (0 == s5r->wbuf_len); /* Should happen first in any transmission, right? */
+  GNUNET_assert (SOCKS_BUFFERSIZE - s5r->wbuf_len >=
+                 sizeof(struct Socks5ServerResponseMessage));
   s_resp = (struct Socks5ServerResponseMessage *) &s5r->wbuf[s5r->wbuf_len];
   memset (s_resp, 0, sizeof(struct Socks5ServerResponseMessage));
   s_resp->version = SOCKS_VERSION_5;
index 064f38c9fcf6f69050db99fefd4179d51ffe59ad..82b8502e0bc938e17f3b3ced967af076e259b2bd 100644 (file)
@@ -49,9 +49,10 @@ struct GNUNET_JSON_Specification;
  * @return #GNUNET_SYSERR on error,
  *         #GNUNET_OK on success
  */
-typedef int (*GNUNET_JSON_Parser) (void *cls,
-                                   json_t *root,
-                                   struct GNUNET_JSON_Specification *spec);
+typedef int
+(*GNUNET_JSON_Parser) (void *cls,
+                       json_t *root,
+                       struct GNUNET_JSON_Specification *spec);
 
 
 /**
@@ -60,8 +61,9 @@ typedef int (*GNUNET_JSON_Parser) (void *cls,
  * @param cls closure
  * @param spec our specification entry with data to clean.
  */
-typedef void (*GNUNET_JSON_Cleaner) (void *cls,
-                                     struct GNUNET_JSON_Specification *spec);
+typedef void
+(*GNUNET_JSON_Cleaner) (void *cls,
+                        struct GNUNET_JSON_Specification *spec);
 
 
 /**