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

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

dhcpd reports e.g: unable to add reverse map from to ipod.lingbrae: timed out

mydns[9731]: segfault at 0 ip b75117fe sp bff5cb9c error 6 in[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);
               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.