Carl Shapiro pushed to branch master at cmucl / cmucl
Commits: 557dd71f by Carl Shapiro at 2024-04-28T14:41:49-07:00 Return an error if a copy of *CMUCL-LIB* cannot be allocated
Previously, the malloc and strdup calls were assumed to succeed. Now, their return values are checked for an error signal. Consistent with other failures in this file, a value of -1 is returned.
- - - - - b2fb3f8d by Carl Shapiro at 2024-04-29T01:02:35+00:00 Merge branch 'elf-c-unchecked-malloc' into 'master'
Return an error if a copy of *CMUCL-LIB* cannot be allocated
See merge request cmucl/cmucl!217 - - - - -
1 changed file:
- src/lisp/elf.c
Changes:
===================================== src/lisp/elf.c ===================================== @@ -333,13 +333,20 @@ obj_run_linker(long init_func_address, char *file) extern int debug_lisp_search; #ifndef UNICODE paths = strdup((char *)vec->data); + if (paths == NULL) { + perror("strdup"); + return -1; + } #else /* * What should we do here with 16-bit characters? For now we just * take the low 8-bits. */ paths = malloc(vec->length); - { + if (paths == NULL) { + perror("malloc"); + return -1; + } else { int k; unsigned short *data; data = (unsigned short*) vec->data;
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5b3f4145422d2c70ca7a717...