projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
435b218
)
fix possible NULL pointer access, thanks to the CLANG static analyser.
author
Wilfried Goesgens
<dothebart@citadel.org>
Tue, 24 May 2011 21:55:08 +0000
(21:55 +0000)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Tue, 24 May 2011 21:55:08 +0000
(21:55 +0000)
webcit/html2html.c
patch
|
blob
|
history
diff --git
a/webcit/html2html.c
b/webcit/html2html.c
index 4185b1fedae980fc58db27c7feec74ddb6c1ec24..b91218b215d99cf8e06d2df7d3d4789da453accc 100644
(file)
--- a/
webcit/html2html.c
+++ b/
webcit/html2html.c
@@
-529,17
+529,19
@@
void output_html(const char *supplied_charset, int treat_as_wiki, int msgnum, St
* so we don't turn things that look like URL's into
* links, when they're already links - or image sources.
*/
* so we don't turn things that look like URL's into
* links, when they're already links - or image sources.
*/
- if ((ptr > msg) && (*(ptr-1) == '<')) {
+ if ((ptr
!= NULL) && (ptr
> msg) && (*(ptr-1) == '<')) {
++brak;
}
++brak;
}
- if ((ptr > msg) && (*(ptr-1) == '>')) {
+ if ((ptr
!= NULL) && (ptr
> msg) && (*(ptr-1) == '>')) {
--brak;
if ((scriptlevel == 0) && (script_start_pos >= 0)) {
StrBufCutRight(converted_msg, StrLength(converted_msg) - script_start_pos);
script_start_pos = (-1);
}
}
--brak;
if ((scriptlevel == 0) && (script_start_pos >= 0)) {
StrBufCutRight(converted_msg, StrLength(converted_msg) - script_start_pos);
script_start_pos = (-1);
}
}
- if (!strncasecmp(ptr, "</A>", 3)) --alevel;
+ if ((ptr != NULL) &&
+ !strncasecmp(ptr, "</A>", 3))
+ --alevel;
}
}
}
}