aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-03 18:50:09 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-03 18:50:09 +0200
commit6d7fd3328a2ffe42ef52f914d913f1ee4d290adc (patch)
tree15bc27a8e17a24c67399dd04336b945a02c24a97 /src
parent6fd24eef238349d71ddd5bff7b87b3404e972ba6 (diff)
downloadgnunet-6d7fd3328a2ffe42ef52f914d913f1ee4d290adc.tar.gz
gnunet-6d7fd3328a2ffe42ef52f914d913f1ee4d290adc.zip
fix #6157
Diffstat (limited to 'src')
-rw-r--r--src/util/strings.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util/strings.c b/src/util/strings.c
index be2ec33dc..9510b3b3b 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -972,14 +972,14 @@ GNUNET_STRINGS_string_to_data (const char *enc,
972 void *out, 972 void *out,
973 size_t out_size) 973 size_t out_size)
974{ 974{
975 unsigned int rpos; 975 size_t rpos;
976 unsigned int wpos; 976 size_t wpos;
977 unsigned int bits; 977 unsigned int bits;
978 unsigned int vbit; 978 unsigned int vbit;
979 int ret; 979 int ret;
980 int shift; 980 int shift;
981 unsigned char *uout; 981 unsigned char *uout;
982 unsigned int encoded_len = out_size * 8; 982 size_t encoded_len;
983 983
984 if (0 == enclen) 984 if (0 == enclen)
985 { 985 {
@@ -987,6 +987,8 @@ GNUNET_STRINGS_string_to_data (const char *enc,
987 return GNUNET_OK; 987 return GNUNET_OK;
988 return GNUNET_SYSERR; 988 return GNUNET_SYSERR;
989 } 989 }
990 GNUNET_assert (out_size < SIZE_MAX / 8);
991 encoded_len = out_size * 8;
990 uout = out; 992 uout = out;
991 wpos = out_size; 993 wpos = out_size;
992 rpos = enclen; 994 rpos = enclen;