On Wed, 25 Jan 2012 21:47:01 +0100 Vincent wrote:
VB> I would also like to point that the parsing code in
VB> swrun_procfs_linux.c is fragile: if the kernel truncates one line (or
VB> if the format change), this could cause a segfault because some loops
VB> do not check for '\0'. For example:
VB> 
VB>         for ( cp = buf; *cp != ':'; cp++ )
VB>             ;
VB> 
VB> This will crash if there is no more ':'. The loop could be changed to:
VB> 
VB>         for ( cp = buf; *cp && *cp != ':'; cp++ )
VB>             ;
VB>         if (!*cp) {
VB>             fclose(fp);
VB>             netsnmp_swrun_entry_free(entry);
VB>             continue;
VB>     }
VB> 
VB> Would a simple patch for this be accepted or is the condition too
VB> improbable?

Sure. Better safe than sorry..

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to