[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: HELLO-TNG: Fix parsing; sill broken
From: |
gnunet |
Subject: |
[gnunet] branch master updated: HELLO-TNG: Fix parsing; sill broken |
Date: |
Sun, 21 Feb 2021 16:46:13 +0100 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 783a12b3c HELLO-TNG: Fix parsing; sill broken
783a12b3c is described below
commit 783a12b3c32a1b68ef1bf308066cf2a57f26c0f7
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Sun Feb 21 16:44:51 2021 +0100
HELLO-TNG: Fix parsing; sill broken
---
src/hello/hello-ng.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/hello/hello-ng.c b/src/hello/hello-ng.c
index dd3480a48..27fd50763 100644
--- a/src/hello/hello-ng.c
+++ b/src/hello/hello-ng.c
@@ -112,12 +112,13 @@ GNUNET_HELLO_extract_address (const void *raw,
{
const struct GNUNET_CRYPTO_EddsaPublicKey *public_key = &pid->public_key;
const char *raws = raw;
- unsigned long long raw_us;
- unsigned int raw_nt;
+ unsigned long long raw_us = 0;
+ unsigned int raw_nt = 0;
const char *sc;
const char *sc2;
const char *sc3;
const char *raw_addr;
+ char *data = NULL;
struct GNUNET_TIME_Absolute raw_mono_time;
struct SignedAddress sa;
struct GNUNET_CRYPTO_EddsaSignature *sig;
@@ -142,22 +143,21 @@ GNUNET_HELLO_extract_address (const void *raw,
GNUNET_break_op (0);
return NULL;
}
- if (1 != sscanf (sc + 1, "%llu;%u;", &raw_us, &raw_nt))
+ if (2 != sscanf (sc + 1, "%llu;%u;%*s", &raw_us, &raw_nt))
{
GNUNET_break_op (0);
return NULL;
}
+ raw_addr = sc3 + 1;
raw_mono_time.abs_value_us = raw_us;
- sig = NULL;
- if (sizeof(struct GNUNET_CRYPTO_EddsaSignature) !=
- GNUNET_STRINGS_base64_decode (raws, sc - raws, (void **) &sig))
+ if (sizeof(struct GNUNET_CRYPTO_EddsaSignature) !=
+ GNUNET_STRINGS_base64_decode (raws, sc - raws, (void **) &data))
{
GNUNET_break_op (0);
- GNUNET_free (sig);
+ GNUNET_free (data);
return NULL;
}
- raw_addr = sc3 + 1;
-
+ sig = (struct GNUNET_CRYPTO_EddsaSignature*) data;
sa.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_ADDRESS);
sa.purpose.size = htonl (sizeof(sa));
sa.mono_time = GNUNET_TIME_absolute_hton (raw_mono_time);
@@ -169,12 +169,10 @@ GNUNET_HELLO_extract_address (const void *raw,
public_key))
{
GNUNET_break_op (0);
- GNUNET_free (sig);
return NULL;
}
- GNUNET_free (sig);
*mono_time = raw_mono_time;
- *nt = (enum GNUNET_NetworkType) raw_nt;
+ *nt = raw_nt;
return GNUNET_strdup (raw_addr);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: HELLO-TNG: Fix parsing; sill broken,
gnunet <=