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