projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3074dad
)
Fix ASAN warning.
author
Guus Sliepen
<guus@tinc-vpn.org>
Mon, 26 Jul 2021 14:03:44 +0000
(16:03 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Mon, 26 Jul 2021 14:03:44 +0000
(16:03 +0200)
The commit fixing the stack overflow for malformed Subnets could compare
against a NULL pointer, which works fine in practice but is undefined
behavior.
src/subnet_parse.c
patch
|
blob
|
history
diff --git
a/src/subnet_parse.c
b/src/subnet_parse.c
index
044d6e7
..
312e310
100644
(file)
--- a/
src/subnet_parse.c
+++ b/
src/subnet_parse.c
@@
-307,7
+307,7
@@
bool str2net(subnet_t *subnet, const char *subnetstr) {
char *last_colon = strrchr(str, ':');
/* Check that the last colon is not further than possible in an IPv6 address */
- if(last_colon >= str + 5 * 8) {
+ if(last_colon
&& last_colon
>= str + 5 * 8) {
return false;
}