gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated (f0da29531 -> 749a3f960)


From: gnunet
Subject: [gnunet] branch master updated (f0da29531 -> 749a3f960)
Date: Fri, 12 Jan 2024 13:28:04 +0100

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

sebi pushed a change to branch master
in repository gnunet.

    from f0da29531 more debian packaging fixes
     new a2b4a0a92 GNS: lightest test fix wrong identifier
     new 749a3f960 GNS: fix potential memory access violation

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/cli/gns/test_gns_lightest.sh              | 28 +++++++++++++--------------
 src/service/gns/gnunet-service-gns_resolver.c | 11 ++++++++++-
 2 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/src/cli/gns/test_gns_lightest.sh b/src/cli/gns/test_gns_lightest.sh
index e604691a4..2d2203e66 100755
--- a/src/cli/gns/test_gns_lightest.sh
+++ b/src/cli/gns/test_gns_lightest.sh
@@ -24,9 +24,9 @@ TEST_URI="10 1 
\"https://ec.europa.eu/tools/lotl/eu-lotl.xml\"";
 TEST_SMIMEA="3 0 1 
f7e8e4e554fb7c7a8f6f360e0ca2f59d466c8f9539a25963f5ed37e905f0c797"
 SCHEME="_scheme"
 TRUST="_trust"
-TRUSTLIST="_trustlist"
+TRANSLATION="_translation"
 TEST_PTR="$SCHEME.$TRUST.$LABEL.$MY_EGO.$START_EGO"
-TEST_PTR2="$TRUSTLIST.$TRUST.$LABEL.$MY_EGO.$START_EGO"
+TEST_PTR2="$TRANSLATION.$TRUST.$LABEL.$MY_EGO.$START_EGO"
 gnunet-arm -s -c test_gns_lookup.conf
 gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
 gnunet-identity -C $START_EGO -c test_gns_lookup.conf
@@ -40,7 +40,7 @@ gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t BOX -V "49152 
49153 53 $TEST_SMIM
 gnunet-namestore -p -z $START_EGO -a -n $MY_EGO -t PKEY -V "$PKEY" -e never -c 
test_gns_lookup.conf
 sleep 0.5
 PTR_SCHEME=`$DO_TIMEOUT gnunet-gns --raw -u 
$SCHEME.$TRUST.$PTR_LABEL.$MY_EGO.$START_EGO -t PTR -c test_gns_lookup.conf`
-PTR_TRUSTLIST=`$DO_TIMEOUT gnunet-gns --raw -u 
$TRUSTLIST.$TRUST.$PTR_LABEL.$MY_EGO.$START_EGO -t PTR -c test_gns_lookup.conf`
+PTR_TRANSLATION=`$DO_TIMEOUT gnunet-gns --raw -u 
$TRANSLATION.$TRUST.$PTR_LABEL.$MY_EGO.$START_EGO -t PTR -c 
test_gns_lookup.conf`
 
 SUCCESS=0
 if [ "$PTR_SCHEME" != "$TEST_PTR" ]
@@ -51,12 +51,12 @@ else
   echo "Resolved to proper PTR, got '$PTR_SCHEME'."
 fi
 
-if [ "$PTR_TRUSTLIST" != "$TEST_PTR2" ]
+if [ "$PTR_TRANSLATION" != "$TEST_PTR2" ]
 then
-  echo "Failed to resolve to proper PTR, got '$PTR_TRUSTLIST'."
+  echo "Failed to resolve to proper PTR, got '$PTR_TRANSLATION'."
   SUCCESS=1
 else
-  echo "Resolved to proper PTR, got '$PTR_TRUSTLIST'."
+  echo "Resolved to proper PTR, got '$PTR_TRANSLATION'."
 fi
 
 if [ "$SUCCESS" = "1" ]
@@ -72,8 +72,8 @@ fi
 RES_URI_SCHEME=`$DO_TIMEOUT gnunet-gns --raw -u $PTR_SCHEME -t URI -c 
test_gns_lookup.conf`
 RES_SMIMEA_SCHEME=`$DO_TIMEOUT gnunet-gns --raw -u $PTR_SCHEME -t SMIMEA -c 
test_gns_lookup.conf`
 
-RES_URI_TRUSTLIST=`$DO_TIMEOUT gnunet-gns --raw -u $PTR_TRUSTLIST -t URI -c 
test_gns_lookup.conf`
-RES_SMIMEA_TRUSTLIST=`$DO_TIMEOUT gnunet-gns --raw -u $PTR_TRUSTLIST -t SMIMEA 
-c test_gns_lookup.conf`
+RES_URI_TRANSLATION=`$DO_TIMEOUT gnunet-gns --raw -u $PTR_TRANSLATION -t URI 
-c test_gns_lookup.conf`
+RES_SMIMEA_TRANSLATION=`$DO_TIMEOUT gnunet-gns --raw -u $PTR_TRANSLATION -t 
SMIMEA -c test_gns_lookup.conf`
 
 
 if [ "$RES_URI_SCHEME" != "$TEST_URI" ]
@@ -92,20 +92,20 @@ else
   echo "Resolved to proper SMIMEA, got '$RES_SMIMEA_SCHEME'."
 fi
 
-if [ "$RES_URI_TRUSTLIST" != "$TEST_URI" ]
+if [ "$RES_URI_TRANSLATION" != "$TEST_URI" ]
 then
-  echo "Failed to resolve to proper URI, got '$RES_URI_TRUSTLIST'."
+  echo "Failed to resolve to proper URI, got '$RES_URI_TRANSLATION'."
   SUCCESS=1
 else
-  echo "Resolved to proper URI, got '$RES_URI_TRUSTLIST'."
+  echo "Resolved to proper URI, got '$RES_URI_TRANSLATION'."
 fi
 
-if [ "$RES_SMIMEA_TRUSTLIST" != "$TEST_SMIMEA" ]
+if [ "$RES_SMIMEA_TRANSLATION" != "$TEST_SMIMEA" ]
 then
-  echo "Failed to resolve to proper SMIMEA, got '$RES_SMIMEA_TRUSTLIST'."
+  echo "Failed to resolve to proper SMIMEA, got '$RES_SMIMEA_TRANSLATION'."
   SUCCESS=1
 else
-  echo "Resolved to proper SMIMEA, got '$RES_SMIMEA_TRUSTLIST'."
+  echo "Resolved to proper SMIMEA, got '$RES_SMIMEA_TRANSLATION'."
 fi
 
 gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t BOX -V "49152 49152 256 10 1 
\"thisisnotavaliduri\"" -e never -c test_gns_lookup.conf
diff --git a/src/service/gns/gnunet-service-gns_resolver.c 
b/src/service/gns/gnunet-service-gns_resolver.c
index 7af756aaf..0d7a1cee8 100644
--- a/src/service/gns/gnunet-service-gns_resolver.c
+++ b/src/service/gns/gnunet-service-gns_resolver.c
@@ -2397,7 +2397,16 @@ handle_gns_resolution_result (void *cls,
             box = rd[i].data;
             const char *prefix = rd[i].data + sizeof(struct
                                                      
GNUNET_GNSRECORD_SBoxRecord);
-            size_t prefix_len = strlen (prefix) + 1;
+            size_t prefix_len = strnlen (prefix, rd[i].data_size - 
sizeof(struct
+                                                                          
GNUNET_GNSRECORD_SBoxRecord))
+                                + 1;
+            if (prefix_len - 1 >= rd[i].data_size - sizeof(struct
+                                                           
GNUNET_GNSRECORD_SBoxRecord))
+            {
+              GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                          "SBOX record with invalid prefix length, maybe not 
null-terminated\n");
+              continue;
+            }
             GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                         "Got SBOX record, checking if prefixes match... %s vs 
%s\n",
                         prefix, rh->prefix);

-- 
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]