diff options
Diffstat (limited to 'src/lib/util/common_logging.c')
-rw-r--r-- | src/lib/util/common_logging.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/util/common_logging.c b/src/lib/util/common_logging.c index fb3db70db..a0fb14368 100644 --- a/src/lib/util/common_logging.c +++ b/src/lib/util/common_logging.c | |||
@@ -1532,7 +1532,8 @@ GNUNET_hex2b (const char *src, void *dst, size_t dstlen, int invert) | |||
1532 | int read_byte; | 1532 | int read_byte; |
1533 | int data_len = 0; | 1533 | int data_len = 0; |
1534 | 1534 | ||
1535 | while (sscanf (data, " %02x%n", &read_byte, &off) == 1) | 1535 | while ((data_len < dstlen) && |
1536 | (sscanf (data, " %02x%n", &read_byte, &off) == 1)) | ||
1536 | { | 1537 | { |
1537 | if (invert) | 1538 | if (invert) |
1538 | buf[dstlen - 1 - data_len++] = read_byte; | 1539 | buf[dstlen - 1 - data_len++] = read_byte; |
@@ -1564,6 +1565,7 @@ GNUNET_print_bytes (const void *buf, size_t buf_len, int fold, int in_be) | |||
1564 | printf ("\n"); | 1565 | printf ("\n"); |
1565 | } | 1566 | } |
1566 | 1567 | ||
1568 | |||
1567 | void | 1569 | void |
1568 | GNUNET_util_cl_init (void); | 1570 | GNUNET_util_cl_init (void); |
1569 | 1571 | ||