From 00893e79fc62966067af1a106567db96bd170338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 3 Mar 2024 19:11:32 +0100 Subject: New upstream version 1.2 --- tests/setenv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/setenv.c') diff --git a/tests/setenv.c b/tests/setenv.c index ebfd4e55..9e2e9e2f 100644 --- a/tests/setenv.c +++ b/tests/setenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995-2003, 2005-2022 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2003, 2005-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. This file is free software: you can redistribute it and/or modify @@ -82,6 +82,7 @@ typedef int (*compar_fn_t) (const void *, const void *); static void *known_values; # define KNOWN_VALUE(Str) \ + __extension__ \ ({ \ void *value = tfind (Str, &known_values, (compar_fn_t) strcmp); \ value != NULL ? *(char **) value : NULL; \ @@ -375,6 +376,11 @@ rpl_setenv (const char *name, const char *value, int replace) int saved_errno; size_t len = strlen (value); tmp = malloca (len + 2); + if (tmp == NULL) + { + errno = ENOMEM; + return -1; + } /* Since leading '=' is eaten, double it up. */ *tmp = '='; memcpy (tmp + 1, value, len + 1); -- cgit v1.2.3