+2023-06-02 Bruno Haible <bruno@clisp.org>
+
+ striconveha: Don't crash if malloc() returns NULL.
+ * lib/striconveha.c (mem_iconveha, str_iconveha): Check malloca() return
+ value.
+
2023-06-02 Bruno Haible <bruno@clisp.org>
setenv: Don't crash if malloc() returns NULL.
int retval;
size_t len = strlen (to_codeset);
char *to_codeset_suffixed = (char *) malloca (len + 10 + 1);
+ if (to_codeset_suffixed == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
memcpy (to_codeset_suffixed, to_codeset, len);
memcpy (to_codeset_suffixed + len, "//TRANSLIT", 10 + 1);
char *result;
size_t len = strlen (to_codeset);
char *to_codeset_suffixed = (char *) malloca (len + 10 + 1);
+ if (to_codeset_suffixed == NULL)
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
memcpy (to_codeset_suffixed, to_codeset, len);
memcpy (to_codeset_suffixed + len, "//TRANSLIT", 10 + 1);