<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:html="http://www.w3.org/1999/html" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Ross Burton</title><link>http://www.burtonini.com/blog</link><description>A potted account of Ross' life</description><language>en</language><ttl>60</ttl><dc:creator>Ross Burton</dc:creator><admin:generatorAgent rdf:resource="http://pyblosxom.sourceforge.net/"/><admin:errorReportsTo rdf:resource="mailto:ross@burtonini.com"/><item><title>Shock and Awe</title><guid isPermaLink="false">computers/shock-2007-06-12-21-58</guid><link>http://www.burtonini.com/blog/computers/shock-2007-06-12-21-58</link><description>From The Hacker's Guide To GPSD : The best way to avoid having dynamic-memory allocation problems is not to use ...</description><content:encoded><![CDATA[    <p>
      From <a href="http://gpsd.berlios.de/hacking.html">The Hacker's Guide To
      GPSD</a>:
    </p>
    <blockquote>
      <q>
        The best way to avoid having dynamic-memory allocation problems is not
        to use malloc/free at all.
      </q>
    </blockquote>
    <p>
      An interesting approach to avoiding dynamic memory problems which in
      general are not that hard to debug with good tools (such as Valgrind), especially in relatively simple pieces of code like gpsd.  However, in the next section:
    </p>
    <blockquote>
      <q>
        The parsing of GPGSV sentences in the NMEA driver has been a persistent
        and nasty trouble spot, causing more buffer overruns and weird secondary
        damage than all the rest of the code put together.
      </q>
    </blockquote>
    <p>
      Personally, I often find that not allocating buffers on the stack and
      using dynamically allocated memory with length-bounded functions helps fix
      buffer overruns.
    </p>
]]></content:encoded><category domain="http://www.burtonini.com">/computers</category><dc:date>2007-06-12T20:58:00Z</dc:date></item></channel></rss>