FYI: About a week ago, Ntop incorporated a patch to replace this common
construct:

    if(snprintf(tmpBuf, sizeof(tmpBuf), "<TR %s><TD "TD_BG">",
getRowColor()) < 0)
      traceEvent(TRACE_ERROR, "Buffer overflow!");

by a simple macro which also reports the program and line number:

    if(snprintf(tmpBuf, sizeof(tmpBuf), "<TR %s><TD "TD_BG">",
getRowColor()) < 0)
      BufferOverflow();


If you are writing code, or patching it, please keep that in mind.


A simple sed script to automate the fixup is this:

for i in `ls *.c`; do
    echo "     Processing" $i "..." >>patchlog
    mv $i $i.pre
    sed -e 's/traceEvent(TRACE_ERROR, \"Buffer
overflow!\");/BufferOverflow();/g' $i.pre >$i
    rm $i.pre
done

If you want to see the macro, it's in ntop.h, but it looks just like all the
others...

I've asked Luca to make the change in the plugins, which I missed the 1st
time.  However, there are still older constructs in report.c, ssl.c,
dataFormat.c and logger.c

-----Burton

_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listmanager.unipi.it/mailman/listinfo/ntop-dev

Reply via email to