Mantis - MyDNS-NG
Viewing Issue Advanced Details
65 Global crash always 2011-03-08 14:40 2011-03-08 14:40
nottledim  
 
normal  
new pre-1.2.8.4  
open  
none    
none  
0000065: Segv when updating reverse zones
MyDNS version: 1.2.8.31

when isc-dhcpd tries to add/delete reverse maps it causes mysns to segfault.

dhcpd reports e.g: unable to add reverse map from
112.1.168.192.in-addr.arpa. to ipod.lingbrae: timed out

mydns[9731]: segfault at 0 ip b75117fe sp bff5cb9c error 6 in
libc-2.11.2.so[b749e000+140000]
Problem has been traced to approx line 1131 in update.c. The strncpy id failing.

       /* Add this stuff to the new tmprr */
       q->tmprr[q->num_tmprr] = ALLOCATE(sizeof(TMPRR), TMPRR);
       strncpy((char*)TMPRR_NAME(q->tmprr[q->num_tmprr]),
(char*)UQRR_NAME(rr),
               sizeof(TMPRR_NAME(q->tmprr[q->num_tmprr])) - 1);
       q->tmprr[q->num_tmprr]->type = rr->type;

This is due to dest bufr (char*)TMPRR_NAME(q->tmprr[q->num_tmprr]) returning NULL pointer. There appears to be no buffer allocated for this string.

The attached patch offers a partial fix. It is not complete as a buffer is allocated but not freed.
? file icon mydns.patch [^] (1,055 bytes) 2011-03-08 14:40
Issue History
2011-03-08 14:40 nottledim New Issue
2011-03-08 14:40 nottledim File Added: mydns.patch

There are no notes attached to this issue.