diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-11-29 22:26:21 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-11-29 22:26:21 +0100 |
commit | e871f8368c8a1f0867f68f656875e4c37c26f298 (patch) | |
tree | c2aa6a2b40213d695e8f047a51695563f44d74b8 /src/gns/gnunet-service-gns.c | |
parent | f8bccfbb602bdbed4bcc00fd3c6c3a00add82416 (diff) | |
download | gnunet-e871f8368c8a1f0867f68f656875e4c37c26f298.tar.gz gnunet-e871f8368c8a1f0867f68f656875e4c37c26f298.zip |
finish (?) libgnunetatstransport for now
Diffstat (limited to 'src/gns/gnunet-service-gns.c')
-rw-r--r-- | src/gns/gnunet-service-gns.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 71e744733..bd9d17895 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c | |||
@@ -11,7 +11,7 @@ | |||
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 | Affero 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 Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
@@ -396,19 +396,12 @@ static int | |||
396 | check_lookup (void *cls, | 396 | check_lookup (void *cls, |
397 | const struct LookupMessage *l_msg) | 397 | const struct LookupMessage *l_msg) |
398 | { | 398 | { |
399 | size_t msg_size; | 399 | size_t nlen; |
400 | const char* name; | ||
401 | 400 | ||
402 | (void) cls; | 401 | (void) cls; |
403 | msg_size = ntohs (l_msg->header.size); | 402 | GNUNET_MQ_check_zero_termination (l_msg); |
404 | if (msg_size < sizeof (struct LookupMessage)) | 403 | nlen = ntohs (l_msg->header.size) - sizeof (struct LookupMessage); |
405 | { | 404 | if (nlen > GNUNET_DNSPARSER_MAX_NAME_LENGTH) |
406 | GNUNET_break (0); | ||
407 | return GNUNET_SYSERR; | ||
408 | } | ||
409 | name = (const char *) &l_msg[1]; | ||
410 | if ( ('\0' != name[msg_size - sizeof (struct LookupMessage) - 1]) || | ||
411 | (strlen (name) > GNUNET_DNSPARSER_MAX_NAME_LENGTH) ) | ||
412 | { | 405 | { |
413 | GNUNET_break (0); | 406 | GNUNET_break (0); |
414 | return GNUNET_SYSERR; | 407 | return GNUNET_SYSERR; |