diff options
Diffstat (limited to 'src/namestore/namestore_api_monitor.c')
-rw-r--r-- | src/namestore/namestore_api_monitor.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/namestore/namestore_api_monitor.c b/src/namestore/namestore_api_monitor.c index 9ba90833b..16780ad0c 100644 --- a/src/namestore/namestore_api_monitor.c +++ b/src/namestore/namestore_api_monitor.c | |||
@@ -144,6 +144,11 @@ check_result (void *cls, | |||
144 | rd_len = ntohs (lrm->rd_len); | 144 | rd_len = ntohs (lrm->rd_len); |
145 | rd_count = ntohs (lrm->rd_count); | 145 | rd_count = ntohs (lrm->rd_count); |
146 | name_len = ntohs (lrm->name_len); | 146 | name_len = ntohs (lrm->name_len); |
147 | if (name_len > MAX_NAME_LEN) | ||
148 | { | ||
149 | GNUNET_break (0); | ||
150 | return GNUNET_SYSERR; | ||
151 | } | ||
147 | exp_lrm_len = sizeof (struct RecordResultMessage) + name_len + rd_len; | 152 | exp_lrm_len = sizeof (struct RecordResultMessage) + name_len + rd_len; |
148 | if (lrm_len != exp_lrm_len) | 153 | if (lrm_len != exp_lrm_len) |
149 | { | 154 | { |
@@ -156,7 +161,7 @@ check_result (void *cls, | |||
156 | return GNUNET_SYSERR; | 161 | return GNUNET_SYSERR; |
157 | } | 162 | } |
158 | name_tmp = (const char *) &lrm[1]; | 163 | name_tmp = (const char *) &lrm[1]; |
159 | if ((name_tmp[name_len -1] != '\0') || (name_len > MAX_NAME_LEN)) | 164 | if (name_tmp[name_len -1] != '\0') |
160 | { | 165 | { |
161 | GNUNET_break (0); | 166 | GNUNET_break (0); |
162 | return GNUNET_SYSERR; | 167 | return GNUNET_SYSERR; |