Bug 1653371 - Don't used a signed type for a length parameter. r=bytesized
authorMolly Howell <mhowell@mozilla.com>
Fri, 17 Jul 2020 22:25:54 +0000
changeset 541011 b79b6cc78248eea7fda10bfb76aa273c19c9fa65
parent 541010 0c0f777161a9499dd149853ff62d356f75d16c2a
child 541012 cb12688fbb613e0f85a2c30d122ee37e9680f48e
push id37613
push user[email protected]
push dateSat, 18 Jul 2020 09:26:25 +0000
treeherdermozilla-central@08cd64cdbc3b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbytesized
bugs1653371
milestone80.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1653371 - Don't used a signed type for a length parameter. r=bytesized Differential Revision: https://phabricator.services.mozilla.com/D84031
modules/libmar/src/mar_read.c
--- a/modules/libmar/src/mar_read.c
+++ b/modules/libmar/src/mar_read.c
@@ -21,17 +21,17 @@
    bytes above from the additionalBlockSize: We subtract
    sizeof(additionalBlockSize) and sizeof(additionalBlockID) */
 #define MAXADDITIONALBLOCKSIZE 96
 
 static uint32_t mar_hash_name(const char* name) {
   return CityHash64(name, strlen(name)) % TABLESIZE;
 }
 
-static int mar_insert_item(MarFile* mar, const char* name, int namelen,
+static int mar_insert_item(MarFile* mar, const char* name, uint32_t namelen,
                            uint32_t offset, uint32_t length, uint32_t flags) {
   MarItem *item, *root;
   uint32_t hash;
 
   item = (MarItem*)malloc(sizeof(MarItem) + namelen);
   if (!item) {
     return -1;
   }