gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 01/05: util: handle possible integer overflow in SRV parsing. F


From: gnunet
Subject: [gnunet] 01/05: util: handle possible integer overflow in SRV parsing. Fixes #9326
Date: Tue, 05 Nov 2024 09:15:30 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

commit 6833ac821a6717b8a59cfc4727360341bd0040fc
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Tue Nov 5 09:05:48 2024 +0100

    util: handle possible integer overflow in SRV parsing. Fixes #9326
---
 src/lib/util/dnsparser.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/util/dnsparser.c b/src/lib/util/dnsparser.c
index c1ce17823..ae6d12553 100644
--- a/src/lib/util/dnsparser.c
+++ b/src/lib/util/dnsparser.c
@@ -1221,7 +1221,8 @@ GNUNET_DNSPARSER_builder_add_srv (char *dst,
   struct GNUNET_TUN_DnsSrvRecord sd;
   int ret;
 
-  if (*off + sizeof(struct GNUNET_TUN_DnsSrvRecord) > dst_len)
+  GNUNET_assert (*off <= SIZE_MAX - sizeof (sd));
+  if (*off + sizeof(sd) > dst_len)
     return GNUNET_NO;
   sd.prio = htons (srv->priority);
   sd.weight = htons (srv->weight);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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