Print this page
11972 resync smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/allocate.c
          +++ new/usr/src/tools/smatch/src/allocate.c
↓ open down ↓ 95 lines elided ↑ open up ↑
  96   96          }
  97   97  
  98   98          desc->allocations++;
  99   99          desc->useful_bytes += size;
 100  100          size = (size + alignment - 1) & ~(alignment-1);
 101  101          if (!blob || blob->left < size) {
 102  102                  unsigned int offset, chunking = desc->chunking;
 103  103                  struct allocation_blob *newblob = blob_alloc(chunking);
 104  104                  if (!newblob)
 105  105                          die("out of memory");
      106 +                if (size > chunking)
      107 +                        die("alloc too big");
 106  108                  desc->total_bytes += chunking;
 107  109                  newblob->next = blob;
 108  110                  blob = newblob;
 109  111                  desc->blobs = newblob;
 110  112                  offset = offsetof(struct allocation_blob, data);
 111  113                  offset = (offset + alignment - 1) & ~(alignment-1);
 112  114                  blob->left = chunking - offset;
 113  115                  blob->offset = offset - offsetof(struct allocation_blob, data);
 114  116          }
 115  117          retval = blob->data + blob->offset;
↓ open down ↓ 38 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX