Menu

#77 Bug in ns_mktemp?

Bug
closed-fixed
nobody
None
5
2016-10-30
2016-10-30
No

Calling ns_mktemp (naviserver-4.99.13) with a template string will result in an alloc error and server crash.

E.g.:
ns_mktemp "/tmp/test-XXXXXX"
Fatal: alloc: invalid block: 0x7f5754452300: 20 27

I had a look in the file "tclfile.c" and function "NsTclMkTempObjCmd". Problem was caused by following line of code:
char *buffer = strdup(templateString);

Change it to:
char buffer = ns_*strdup(templateString);

Now it works. Is there something wrong with my installation? Or is this a bug?

Thank you

Discussion

  • gustafn

    gustafn - 2016-10-30
    • status: open --> closed-fixed
     
  • Patrick Heissenberger

    Thanks for the quick fix.

     
    • gustafn

      gustafn - 2016-10-31

      The nasty part was, that the bug does not show up with our installations (and my test servers), which use a modified version of tcl based on SYSTEM_MALLOC (e.g. google perf tools). High, probably, we need a quick release, since the bug will hurt standard OpenACS sites.

       

Log in to post a comment.

MongoDB Logo MongoDB