summaryrefslogtreecommitdiff
path: root/rr.c
diff options
context:
space:
mode:
authorWouter Wijngaards <wouter@NLnetLabs.nl>2009-08-05 16:47:20 +0200
committerWouter Wijngaards <wouter@NLnetLabs.nl>2009-08-05 16:47:20 +0200
commit831378367681025d89ecc71c288d985d652351c8 (patch)
tree5ec28df2a21ec41639d0db79035d9d53aa22abbd /rr.c
parent1c21cdd9ff3b705612b55ea8fd7f5f950287cc95 (diff)
downloadldns-831378367681025d89ecc71c288d985d652351c8.tar.gz
Fixed out of buffer reference, in case . is read, then rd_strlen==size==1 and data[0]==0.
Diffstat (limited to 'rr.c')
-rw-r--r--rr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rr.c b/rr.c
index 5a9dfbde..a900bf3f 100644
--- a/rr.c
+++ b/rr.c
@@ -468,7 +468,8 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
rd);
/* check if the origin should be used or concatenated */
- if (rd_strlen == 1 && ldns_rdf_data(r)[1] == '@') {
+ if (ldns_rdf_size(r) > 0 && ldns_rdf_data(r)[0] == 1
+ && ldns_rdf_data(r)[1] == '@') {
ldns_rdf_deep_free(r);
if (origin) {
r = ldns_rdf_clone(origin);