diff options
Diffstat (limited to 'src/service/gns/gnunet-service-gns_resolver.c')
-rw-r--r-- | src/service/gns/gnunet-service-gns_resolver.c | 11 |
1 files changed, 10 insertions, 1 deletions
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, | |||
2397 | box = rd[i].data; | 2397 | box = rd[i].data; |
2398 | const char *prefix = rd[i].data + sizeof(struct | 2398 | const char *prefix = rd[i].data + sizeof(struct |
2399 | GNUNET_GNSRECORD_SBoxRecord); | 2399 | GNUNET_GNSRECORD_SBoxRecord); |
2400 | size_t prefix_len = strlen (prefix) + 1; | 2400 | size_t prefix_len = strnlen (prefix, rd[i].data_size - sizeof(struct |
2401 | GNUNET_GNSRECORD_SBoxRecord)) | ||
2402 | + 1; | ||
2403 | if (prefix_len - 1 >= rd[i].data_size - sizeof(struct | ||
2404 | GNUNET_GNSRECORD_SBoxRecord)) | ||
2405 | { | ||
2406 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
2407 | "SBOX record with invalid prefix length, maybe not null-terminated\n"); | ||
2408 | continue; | ||
2409 | } | ||
2401 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2410 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2402 | "Got SBOX record, checking if prefixes match... %s vs %s\n", | 2411 | "Got SBOX record, checking if prefixes match... %s vs %s\n", |
2403 | prefix, rh->prefix); | 2412 | prefix, rh->prefix); |