openbsd-ports/converters/libytnef/patches/patch-lib_ytnef_c
2022-03-11 18:27:00 +00:00

16 lines
867 B
Plaintext

this allocation check is just useless especially with big winmail.dat files
so disable it to actually make the software usable
Index: lib/ytnef.c
--- lib/ytnef.c.orig
+++ lib/ytnef.c
@@ -55,7 +55,7 @@
#define MIN(x,y) (((x)<(y))?(x):(y))
-#define PREALLOCCHECK(sz,max) { if(sz==0||(unsigned)sz>max) { printf("ERROR: invalid alloc size %u at %s : %i, suspected corruption (exceeded %i bytes)\n", (unsigned)sz, __FILE__, __LINE__, max); return(-1); } }
+#define PREALLOCCHECK(sz,max)
#define ALLOCCHECK(x) { if(!x) { printf("Out of Memory at %s : %i\n", __FILE__, __LINE__); return(-1); } }
#define ALLOCCHECK_CHAR(x) { if(!x) { printf("Out of Memory at %s : %i\n", __FILE__, __LINE__); return(NULL); } }
#define SIZECHECK(x) { if ((((char *)d - (char *)data) + x) > size) { printf("Corrupted file detected at %s : %i\n", __FILE__, __LINE__); return(-1); } }