1 From 055ea6aef77058f651b5571d98d2d9458821a977 Mon Sep 17 00:00:00 2001
2 From: Matthijs Mekking <matthijs@nlnetlabs.nl>
3 Date: Wed, 18 Jun 2014 09:55:17 +0200
4 Subject: [PATCH] whitespace bug in ldns-read-zone
6 [Backport from upstream commit d6037a22fbedb8ef3a22de4107e4eaa36840865b]
7 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
9 rr.c | 15 +++++++++++++++
10 1 file changed, 15 insertions(+)
12 diff --git a/rr.c b/rr.c
13 index cfee170..e530702 100644
16 @@ -670,6 +670,18 @@ ldns_rr_new_question_frm_str(ldns_rr **newrr, const char *str,
21 +ldns_rr_is_whitespace_line(char* line, int line_len)
24 + for (i = 0; i < line_len; i++) {
25 + if (!isspace((int)line[i])) {
33 ldns_rr_new_frm_fp(ldns_rr **newrr, FILE *fp, uint32_t *ttl, ldns_rdf **origin, ldns_rdf **prev)
35 @@ -745,6 +757,9 @@ ldns_rr_new_frm_fp_l(ldns_rr **newrr, FILE *fp, uint32_t *default_ttl, ldns_rdf
36 s = LDNS_STATUS_SYNTAX_TTL;
37 } else if (strncmp(line, "$INCLUDE", 8) == 0) {
38 s = LDNS_STATUS_SYNTAX_INCLUDE;
39 + } else if (ldns_rr_is_whitespace_line(line, size)) {
41 + return LDNS_STATUS_SYNTAX_EMPTY;
43 if (origin && *origin) {
44 s = ldns_rr_new_frm_str(&rr, (const char*) line, ttl, *origin, prev);