don't check if the unsigned size passed to mymalloc is negative.
authorTony Cook <tony@develop-help.com>
Mon, 7 Jan 2019 11:59:50 +0000 (22:59 +1100)
committerTony Cook <tony@develop-help.com>
Mon, 7 Jan 2019 11:59:50 +0000 (22:59 +1100)
Changes
io.c

diff --git a/Changes b/Changes
index ec1ffd9..7a77399 100644 (file)
--- a/Changes
+++ b/Changes
@@ -121,6 +121,10 @@ Lower severity (according to Coverity):
  - re-work testing for size_t overflow for circle/random
    super-sampling for fountain fills.  CID 185304.
 
+ - don't check if the unsigned size passed to Imager's malloc wrapper
+   (mymalloc) is negative.  Left from when that parameter was signed.
+   CID 185305.
+
 [1] The first two build submissions ended up at the end of a ~400
 build queue, and seemed to have been cancelled by Coverity.  A build
 submitted on NYE went through in minutes.
diff --git a/io.c b/io.c
index 3d8c453..222553a 100644 (file)
--- a/io.c
+++ b/io.c
@@ -235,11 +235,6 @@ void*
 mymalloc(size_t size) {
   void *buf;
 
-  if (size < 0) {
-    fprintf(stderr, "Attempt to allocate size %ld\n", (long)size);
-    exit(3);
-  }
-
   if ( (buf = malloc(size)) == NULL ) {
     mm_log((1, "mymalloc: unable to malloc %ld\n", (long)size));
     fprintf(stderr,"Unable to malloc %ld.\n", (long)size); exit(3);