From: <abe...@us...> - 2015-04-07 14:49:01
|
Revision: 7026 http://sourceforge.net/p/astlinux/code/7026 Author: abelbeck Date: 2015-04-07 14:48:58 +0000 (Tue, 07 Apr 2015) Log Message: ----------- dnsmasq, add upstream patch to fix possible crash with cache stats Related: dig +short chaos txt servers.bind Ref: http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=04b0ac05377936d121a36873bb63d492cde292c9 Added Paths: ----------- branches/1.0/package/dnsmasq/dnsmasq-fix-crash-cache-stats.patch Added: branches/1.0/package/dnsmasq/dnsmasq-fix-crash-cache-stats.patch =================================================================== --- branches/1.0/package/dnsmasq/dnsmasq-fix-crash-cache-stats.patch (rev 0) +++ branches/1.0/package/dnsmasq/dnsmasq-fix-crash-cache-stats.patch 2015-04-07 14:48:58 UTC (rev 7026) @@ -0,0 +1,22 @@ +diff --git a/src/cache.c b/src/cache.c +index d7bea57..178d654 100644 +--- a/src/cache.c ++++ b/src/cache.c +@@ -1326,7 +1326,7 @@ int cache_make_stat(struct txt_record *t) + } + port = prettyprint_addr(&serv->addr, daemon->addrbuff); + lenp = p++; /* length */ +- bytes_avail = (p - buff) + bufflen; ++ bytes_avail = bufflen - (p - buff); + bytes_needed = snprintf(p, bytes_avail, "%s#%d %u %u", daemon->addrbuff, port, queries, failed_queries); + if (bytes_needed >= bytes_avail) + { +@@ -1340,7 +1340,7 @@ int cache_make_stat(struct txt_record *t) + lenp = p - 1; + buff = new; + bufflen = newlen; +- bytes_avail = (p - buff) + bufflen; ++ bytes_avail = bufflen - (p - buff); + bytes_needed = snprintf(p, bytes_avail, "%s#%d %u %u", daemon->addrbuff, port, queries, failed_queries); + } + *lenp = bytes_needed; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |