Skip to content

Commit

Permalink
SLHAlloc must return NULL when internal allocations fail
Browse files Browse the repository at this point in the history
The SLHAlloc function keeps using the results of the internal
allocations even when they're NULL which leads to S0C4 ABENDs. This
commit makes SLHAlloc return NULL when the internal allocations fail.

Signed-off-by: Irek Fakhrutdinov <[email protected]>
  • Loading branch information
ifakhrutdinov committed Aug 22, 2024
1 parent 6d46ea2 commit 8698212
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## `2.18.1`
- Bugfix: IARV64 results must be checked for 0x7FFFF000 (#474)
- Bugfix: SLH should not ABEND when MEMLIMIT is reached (additional NULL check)

## `2.18.0`
- Minor `components.zss.logLevels._zss.httpserver=5` debug messages enhancement (#471)
Expand Down
2 changes: 2 additions & 0 deletions c/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,7 @@ char *SLHAlloc(ShortLivedHeap *slh, int size){
safeMalloc31(size+4,"SLH Oversize Extend"));
if (bigBlock == NULL){
reportSLHFailure(slh,size);
return NULL;
}
int *sizePtr = (int*)bigBlock;
*sizePtr = size;
Expand All @@ -1528,6 +1529,7 @@ char *SLHAlloc(ShortLivedHeap *slh, int size){
safeMalloc31(slh->blockSize+4,"SLH Extend") );
if (data == NULL){
reportSLHFailure(slh,size);
return NULL;
}
int *sizePtr = (int*)data;
*sizePtr = slh->blockSize;
Expand Down

0 comments on commit 8698212

Please sign in to comment.