projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
82d4bcc
)
fix threadid NULL deref
author
Philipp Takacs
<philipp@bureaucracy.de>
Sun, 14 May 2023 00:12:49 +0000
(
02:12
+0200)
committer
Philipp Takacs
<philipp@bureaucracy.de>
Sun, 14 May 2023 00:15:53 +0000
(
02:15
+0200)
strchr returns NULL if the character is not found.
sbr/getthreadid.c
patch
|
blob
|
history
diff --git
a/sbr/getthreadid.c
b/sbr/getthreadid.c
index
a1ad7a0
..
abac78d
100644
(file)
--- a/
sbr/getthreadid.c
+++ b/
sbr/getthreadid.c
@@
-54,8
+54,11
@@
threadid(char *msgid, char *referens)
}
start = strchr(threadfrom, '<');
+ if (!start) {
+ return NULL;
+ }
end = strchr(start, '>');
- if (!(*start) || !(*end)) {
+ if (!end) {
return NULL;
}
*end = '\0';