1.4.13 debuglevel bug

  • There is a subtle bug in 1.4.13 (only tested on linux) with debuglevel set greater than 0. Using a command line option with a long format string will cause a segfault. Here is an example


    dgate --setdebuglevel:1
    dgate --get_amap:1,%s%s%s%s


    will cause a segfault, but dgate --get_amap:1,%s%s will not.


    I noticed that the logfile shows output like this:


    9999,0400 16 UN "get_amap:1,ðLõ(null)"


    The incorrect output is also produced in 1.4.12c, but it does not trigger the segfault.

  • Thanks,


    I already fixed it for the next release a few days ago ;->>>. The %s is interpreted as string "pointer" in the dicom dump while it should be printed literally - an old bug. The segfault or not is coincidence: it just whats happens to be on the stack.


    To fix it replace in dprintf.cpp:


    Code
    "fprintf(Debugfp, s);" by "fputs(s, Debugfp);".
    "TroubleLog.printf(s + iLength);" by "TroubleLog.printf("%s", s + iLength);"


    Marcel

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!