Menu

#72 ns_dbquotevalue doesn't escape backslash

open-wont-fix
nobody
API: Tcl (36)
3
2004-06-29
2001-10-24
No

Data with a literal backslash that is submitted to
ns_dbquotevalue will get mangled by insertion into the
database - I found this out when I tried to insert some
C source code with the text '\0' in it, which needed to
be quoted into \\0. The following should be added to
nsdb.tcl.

In ns_dbquotevalue, right after the 'regsub' line, add
another:

regsub -all {\B} $value "\\\\\\\\" value

Unfortunately, yes, that is indeed eight backslashes.
There's probably a way to do it with four \B's instead
- or maybe two. The above is what I did to make it work
for me.

Discussion

  • Kriston Rehberg

    Kriston Rehberg - 2002-02-26
    • assigned_to: nobody --> kriston
     
  • Kriston Rehberg

    Kriston Rehberg - 2003-03-04
    • assigned_to: kriston --> nobody
     
  • Dossy Shiobara

    Dossy Shiobara - 2004-06-29
    • priority: 5 --> 3
    • status: open --> open-wont-fix
     
  • Dossy Shiobara

    Dossy Shiobara - 2004-06-29

    Logged In: YES
    user_id=21885

    I'm tempted to say that this won't get fixed - there's several
    annoying issues with ns_dbquotevalue but I'm hesitant to
    change that proc as lots of code depends on it, and probably
    depends somewhat on its already broken behavior.

    I'm going to leave this open, but marked as "Wont Fix" -- in
    the new DB API, this along with all other ns_dbquotevalue
    issues, should get addressed.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.