diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2015-01-02 08:56:45 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2015-01-02 09:45:18 (GMT) |
commit | 312bef563a5be72f6423377247db1b80044bf711 (patch) | |
tree | 3a656445fa67469b2f1783932fe127e9f39af69a /src/tclscanner.l | |
parent | ed39dab59f8af2c5b42cfac0b3140cf594412121 (diff) | |
download | Doxygen-312bef563a5be72f6423377247db1b80044bf711.zip Doxygen-312bef563a5be72f6423377247db1b80044bf711.tar.gz Doxygen-312bef563a5be72f6423377247db1b80044bf711.tar.bz2 |
Fixed a couple of cases where sharing string data could lead to corruption
Also made dangerous string access more visible by introducing rawData().
This replaces data() which will now return a constant string.
Diffstat (limited to 'src/tclscanner.l')
-rw-r--r-- | src/tclscanner.l | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tclscanner.l b/src/tclscanner.l index f162637..198fd85 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -657,7 +657,7 @@ static void tcl_font_end() } //! Codify 'str' with special font class 's'. -static void tcl_codify(const char *s,char *str) +static void tcl_codify(const char *s,const char *str) { if (!tcl.code || !str) return; if (s && qstrcmp(s,"NULL")!=0) @@ -666,7 +666,7 @@ static void tcl_codify(const char *s,char *str) tcl.code->startFontClass(s); tcl.code_font=s; } - char *p=str,*sp=p; + const char *p=str,*sp=p; char c; bool done=FALSE; while (!done) @@ -676,7 +676,7 @@ static void tcl_codify(const char *s,char *str) if (c=='\n') { tcl.code_line++; - *(p-1)='\0'; + // *(p-1)='\0'; // Dimitri: is this really needed? tcl.code->codify(sp); if (tcl.code_font) { @@ -719,7 +719,6 @@ static void tcl_codify(const char *s,const QString &str) if (tcl.code==NULL) return; tcl_codify(s,str.utf8()); } -#endif //! Codify 'str' with special font class 's'. static void tcl_codify(const char *s,const QCString &str) @@ -727,6 +726,7 @@ static void tcl_codify(const char *s,const QCString &str) if (!tcl.code) return; tcl_codify(s,str.data()); } +#endif static void tcl_codify_cmd(const char *s,int i) { |