git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3857519
)
Use project-standard memory management rather than alloca()
author
Jeremy Harris
<jgh146exb@wizmail.org>
Mon, 16 Oct 2023 10:54:50 +0000
(11:54 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Mon, 16 Oct 2023 10:54:50 +0000
(11:54 +0100)
src/src/string.c
patch
|
blob
|
history
diff --git
a/src/src/string.c
b/src/src/string.c
index 055a37fd66f366af68c480e90db66ec99f9c80ab..51b12c5e527921721213a26745483893db2c0f5a 100644
(file)
--- a/
src/src/string.c
+++ b/
src/src/string.c
@@
-105,9
+105,7
@@
string_is_ip_addressX(const uschar *ip_addr, int *maskptr, const uschar **errp)
if (errp) *errp = "rudiculous long ip address string";
return 0;
}
- addr = alloca(l+1); /* *BSD does not have strndupa() */
- Ustrncpy((uschar *)addr, ip_addr, l);
- ((uschar*)addr)[l] = '\0';
+ addr = string_copyn(ip_addr, l);
} else addr = ip_addr;
int af;