parent
8aa842d2ec
commit
527ebaad94
@ -0,0 +1,14 @@
|
||||
diff --git a/CPP/7zip/Archive/LzhHandler.cpp b/CPP/7zip/Archive/LzhHandler.cpp
|
||||
index 21631f7..1f14621 100644
|
||||
--- a/CPP/7zip/Archive/LzhHandler.cpp
|
||||
+++ b/CPP/7zip/Archive/LzhHandler.cpp
|
||||
@@ -163,7 +163,8 @@ struct CItem
|
||||
return false;
|
||||
}
|
||||
const Byte *data = (const Byte *)(Extensions[index].Data);
|
||||
- value = GetUi32(data);
|
||||
+ if (!data) value = 0;
|
||||
+ else value = GetUi32(data);
|
||||
return true;
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
diff --git a/C/Alloc.c b/C/Alloc.c
|
||||
index 2706ec0..3178e7a 100644
|
||||
--- a/C/Alloc.c
|
||||
+++ b/C/Alloc.c
|
||||
@@ -58,12 +58,18 @@ void align_free(void * ptr)
|
||||
#else
|
||||
void *align_alloc(size_t size)
|
||||
{
|
||||
- return malloc(size);
|
||||
+ void * p = malloc(size);
|
||||
+ if(!p){
|
||||
+ printf("Out of memory: can't allocate %u bytes\n",size);
|
||||
+ abort();
|
||||
+ }
|
||||
+ return p;
|
||||
}
|
||||
|
||||
void align_free(void * ptr)
|
||||
{
|
||||
- free(ptr);
|
||||
+ if(!ptr) return;
|
||||
+ free(ptr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in new issue