diff options
Diffstat (limited to 'src/namestore/namestore_api_monitor.c')
-rw-r--r-- | src/namestore/namestore_api_monitor.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/namestore/namestore_api_monitor.c b/src/namestore/namestore_api_monitor.c index 9ba90833b..6c441d786 100644 --- a/src/namestore/namestore_api_monitor.c +++ b/src/namestore/namestore_api_monitor.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2013, 2016, 2018 GNUnet e.V. | 3 | Copyright (C) 2013, 2016, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | /** | 18 | /** |
21 | * @file namestore/namestore_api_monitor.c | 19 | * @file namestore/namestore_api_monitor.c |
@@ -144,6 +142,11 @@ check_result (void *cls, | |||
144 | rd_len = ntohs (lrm->rd_len); | 142 | rd_len = ntohs (lrm->rd_len); |
145 | rd_count = ntohs (lrm->rd_count); | 143 | rd_count = ntohs (lrm->rd_count); |
146 | name_len = ntohs (lrm->name_len); | 144 | name_len = ntohs (lrm->name_len); |
145 | if (name_len > MAX_NAME_LEN) | ||
146 | { | ||
147 | GNUNET_break (0); | ||
148 | return GNUNET_SYSERR; | ||
149 | } | ||
147 | exp_lrm_len = sizeof (struct RecordResultMessage) + name_len + rd_len; | 150 | exp_lrm_len = sizeof (struct RecordResultMessage) + name_len + rd_len; |
148 | if (lrm_len != exp_lrm_len) | 151 | if (lrm_len != exp_lrm_len) |
149 | { | 152 | { |
@@ -156,7 +159,7 @@ check_result (void *cls, | |||
156 | return GNUNET_SYSERR; | 159 | return GNUNET_SYSERR; |
157 | } | 160 | } |
158 | name_tmp = (const char *) &lrm[1]; | 161 | name_tmp = (const char *) &lrm[1]; |
159 | if ((name_tmp[name_len -1] != '\0') || (name_len > MAX_NAME_LEN)) | 162 | if (name_tmp[name_len -1] != '\0') |
160 | { | 163 | { |
161 | GNUNET_break (0); | 164 | GNUNET_break (0); |
162 | return GNUNET_SYSERR; | 165 | return GNUNET_SYSERR; |