* [PATCH 0/1] handle potential strdup failure @ 2024-07-09 9:06 Ilia Shipitsin 2024-07-09 9:06 ` [PATCH 1/1] src/config.c: handle " Ilia Shipitsin 0 siblings, 1 reply; 3+ messages in thread From: Ilia Shipitsin @ 2024-07-09 9:06 UTC (permalink / raw) To: wireguard; +Cc: Ilia Shipitsin if allocation fails, strdup returns NULL. Ilia Shipitsin (1): src/config.c: handle strdup failure src/config.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.43.0.windows.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] src/config.c: handle strdup failure 2024-07-09 9:06 [PATCH 0/1] handle potential strdup failure Ilia Shipitsin @ 2024-07-09 9:06 ` Ilia Shipitsin 2025-05-20 22:59 ` Jason A. Donenfeld 0 siblings, 1 reply; 3+ messages in thread From: Ilia Shipitsin @ 2024-07-09 9:06 UTC (permalink / raw) To: wireguard; +Cc: Ilia Shipitsin Signed-off-by: Ilia Shipitsin <chipitsine@gmail.com> --- src/config.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/config.c b/src/config.c index 81ccb47..f78e076 100644 --- a/src/config.c +++ b/src/config.c @@ -357,6 +357,12 @@ static inline bool parse_allowedips(struct wgpeer *peer, struct wgallowedip **la char *end, *ip; saved_entry = strdup(mask); + if (!saved_entry) { + perror("strdup"); + free(mutable); + return false; + } + ip = strsep(&mask, "/"); new_allowedip = calloc(1, sizeof(*new_allowedip)); -- 2.43.0.windows.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] src/config.c: handle strdup failure 2024-07-09 9:06 ` [PATCH 1/1] src/config.c: handle " Ilia Shipitsin @ 2025-05-20 22:59 ` Jason A. Donenfeld 0 siblings, 0 replies; 3+ messages in thread From: Jason A. Donenfeld @ 2025-05-20 22:59 UTC (permalink / raw) To: Ilia Shipitsin; +Cc: wireguard Applied, thanks for the patch. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-21 9:18 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-07-09 9:06 [PATCH 0/1] handle potential strdup failure Ilia Shipitsin 2024-07-09 9:06 ` [PATCH 1/1] src/config.c: handle " Ilia Shipitsin 2025-05-20 22:59 ` Jason A. Donenfeld
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).