Hi!

On Linux, hrSWRunPerfCPU and hrSWRunPerfMem have incorrect values. I
have fixed this in a patch that should follow. I will post it on
Sourceforge as soon as I am able to validate my account (the
confirmation mail seems to have been lost).

I would also like to point that the parsing code in
swrun_procfs_linux.c is fragile: if the kernel truncates one line (or
if the format change), this could cause a segfault because some loops
do not check for '\0'. For example:

        for ( cp = buf; *cp != ':'; cp++ )
            ;

This will crash if there is no more ':'. The loop could be changed to:

        for ( cp = buf; *cp && *cp != ':'; cp++ )
            ;
        if (!*cp) {
            fclose(fp);
            netsnmp_swrun_entry_free(entry);
            continue;
        }

Would a simple patch for this be accepted or is the condition too
improbable?


------------------------------------------------------------------------------
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