[exim-cvs] Use project-standard memory management rather tha…

Inizio della pagina
Delete this message
Reply to this message
Autore: Exim Git Commits Mailing List
Data:  
To: exim-cvs
Oggetto: [exim-cvs] Use project-standard memory management rather than alloca()
Gitweb: https://git.exim.org/exim.git/commitdiff/2484c35c5deec375307bd4f51aa89ae5080a4e56
Commit:     2484c35c5deec375307bd4f51aa89ae5080a4e56
Parent:     3857519629ca8fbcf3466c3fc761a5bb6ed32d53
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Mon Oct 16 11:54:50 2023 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon Oct 16 11:54:50 2023 +0100


    Use project-standard memory management rather than alloca()
---
 src/src/string.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)


diff --git a/src/src/string.c b/src/src/string.c
index 055a37fd6..51b12c5e5 100644
--- 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;

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/