projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bba7dc8
)
bmstrcasestr() now returns NULL if either of its supplied
author
Art Cancro
<ajc@citadel.org>
Wed, 19 Mar 2008 17:46:00 +0000
(17:46 +0000)
committer
Art Cancro
<ajc@citadel.org>
Wed, 19 Mar 2008 17:46:00 +0000
(17:46 +0000)
arguments is NULL ... instead of passing NULL to strlen() and making
the program crash.
libcitadel/lib/tools.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/tools.c
b/libcitadel/lib/tools.c
index 32c96e035f569b54f21c05d230144676deee79c9..dd630420fa4b79b57ded590ddcab02414e5192dd 100644
(file)
--- a/
libcitadel/lib/tools.c
+++ b/
libcitadel/lib/tools.c
@@
-772,6
+772,9
@@
char *bmstrcasestr(char *text, char *pattern) {
size_t textlen;
size_t patlen;
+ if (!text) return(NULL);
+ if (!pattern) return(NULL);
+
textlen = strlen (text);
patlen = strlen (pattern);