+2023-06-02 Bruno Haible <bruno@clisp.org>
+
+ setenv: Don't crash if malloc() returns NULL.
+ * lib/setenv.c (rpl_setenv): Check malloca() return value.
+
2023-06-01 Bruno Haible <bruno@clisp.org>
getprogname: Add support for ASCII-compatible environments in z/OS.
-/* Copyright (C) 1992, 1995-2003, 2005-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2003, 2005-2023 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
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);