]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
also skip spaces before optional rdata fields
authorJelte Jansen <jelte@NLnetLabs.nl>
Tue, 26 Aug 2008 10:40:02 +0000 (10:40 +0000)
committerJelte Jansen <jelte@NLnetLabs.nl>
Tue, 26 Aug 2008 10:40:02 +0000 (10:40 +0000)
rr.c

diff --git a/rr.c b/rr.c
index 86da5f4c379c8ab198f3a89c05d9956d94833143..125263eb8b9924f499fe8d83a31ec143b876263a 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -380,8 +380,13 @@ ldns_rr_new_frm_str(ldns_rr **newrr, const char *str, uint32_t default_ttl, ldns
 
                                /* because number of fields can be variable, we can't
                                   rely on _maximum() only */
+                               /* skip spaces */
+                               while (*(ldns_buffer_current(rd_buf)) == ' ') {
+                                       ldns_buffer_skip(rd_buf, 1);
+                               }
+
                                if ((c = ldns_bget_token(rd_buf, rd, delimiters, 
-                                                                       LDNS_MAX_RDFLEN)) != -1) {
+                                                       LDNS_MAX_RDFLEN)) != -1) {
                                        /* hmmz, rfc3597 specifies that any type can be represented with
                                         * \# method, which can contain spaces...
                                         * it does specify size though...