Commit Graph
57 Commits
Author SHA1 Message Date
Nicholas Nethercote 1b81677176 Bug 1232219 (part 1) - Fix -Wunused warnings in libmar/. r=bbondy. 2015-12-16 22:24:19 -08:00
Matt Howell 6a4865fa76 Bug 1209551 - Don't read past the end of a buffer in libmar
The index section of a MAR archive file contains several fixed-length fields
and also variable-length names for each file in the archive, terminated by a
null byte. Since that makes the length of the index variable, the length of the
entire index is also provided in the file.
When libmar opens a file, it allocates a buffer with the length given in the
file and reads the index from the file into that buffer.
mar_consume_index() then parses the entire index from that copy,
trying to make sure it doesn't read past the buffer it was given.

The length of the buffer is given to mar_consume_index()
by providing it a pointer to one byte past the end of the buffer.
However, mar_consume_index() treats this pointer as pointing *to* the end.
Therefore, it is possible for a malformed MAR file (one where the stated length
is less than the real length) to trigger a read of one byte beyond the
allocated memory.

Fix this by failing the parse when we reach the buffer end pointer minus one,
instead of when we reach that address itself.
2015-10-06 09:11:43 -07:00
Nicholas Nethercote 112d083e7c Bug 1202971 (part 1) - Fix compile warnings in libmar. r=rstrong.
Also remove ALLOW_COMPILER_WARNINGS=True so they don't come back.
2015-09-15 17:39:11 -07:00
Nicholas Nethercote 12fec02dfb Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
2015-08-27 20:44:53 -07:00
Stephen Pohl 29faaec3e5 Bug 1184500: Improve handling of index names in MAR files. r=rstrong 2015-07-18 18:42:15 -07:00
Brian Smith 468a4ba048 Bug 903135 - Updates to libmar needed to support B2G MAR signature verification. r=bbondy 2014-10-22 21:00:15 -04:00
Mike Hommey aec0b61280 Bug 1041941 - Use templates for programs, simple programs, libraries and C++ unit tests. r=gps 2014-09-03 14:10:54 +09:00
Shashank Sabniveesu bdbedb5c28 Bug 1021142 - 'fclose()' at 2 places to avoid leaks on failure. r=bbondy 2014-08-28 11:35:50 -07:00
Chris Peterson 08cee7273b Bug 995655 - Fix -Wpointer-sign warnings in libmar. r=rstrong 2013-12-16 16:55:53 -08:00
Ehsan Akhgari be1e735a00 Bug 970745 - Move USE_STATIC_LIBS to moz.build; r=glandium 2014-02-11 09:12:33 -05:00
Ehsan Akhgari b03e874110 Bug 947735 - Build modules/libmar/ in unified mode; r=bbondy 2013-12-09 13:30:27 -05:00
Mike Hommey 7f7e4faac1 Bug 939044 - Remove most definitions of MODULE. r=mshal 2013-11-19 11:47:39 +09:00
Cykesiopka fe95cd11b9 Bug 914270 - Part 1: Simple/Automated moves. r=joey 2013-10-24 18:51:00 +01:00
Mike Hommey 8227d7aa95 Bug 929905 - Consolidate sources in moz.build. r=gps 2013-10-25 08:23:05 +09:00
Mike Hommey b207d5baf7 Bug 912293 - Remove now redundant boilerplate from Makefile.in. r=gps 2013-09-05 09:01:46 +09:00
Ms2ger d8ff09a91a Bug 906619 - Part a: Move unconditional CSRCS to moz.build; r=mshal 2013-08-22 08:56:02 +02:00
Mike Shal 8601e7db6e Bug 904768 - Print filename when failing to open files in libmar; r=netzen 2013-08-13 15:18:03 -04:00
Ehsan Akhgari eb8f049d9e Bug 895322 - Part 4: Only use MOZ_STATIC_ASSERT in mar.h when we're compiling C code; r=Waldo 2013-07-18 14:36:39 -04:00
Ehsan Akhgari 6d396d8bcb Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
Brian R. Bondy a1c5bbbaaf Bug 890853. r=rstrong. 2013-07-22 22:35:20 -04:00
Brian O'Keefe df70c9c82e Bug 875934 - Move LIBRARY_NAME to moz.build (batch #1); r=mshal 2013-06-17 15:21:01 -04:00
Joey Armstrong 103c68bbb3 bug 872087: mozbuild HOST_LIBRARY_NAME conversion cleanup. r=gps 2013-06-19 09:19:25 -04:00
Joey Armstrong 4d3c15a57d bug 875549: mozbuild cleanup for HOST_CSRCS. r=gps 2013-06-18 09:10:50 -04:00
Joey Armstrong 4e678d6b3e bug 875549: move HOST_CSRCS to mozbuild (file batch #1). r=mshal 2013-06-11 11:31:11 -04:00
Joey Armstrong cfe64b626f bug 872087: move HOST_LIBRARY to moz.build (file batch #1). r=mshal 2013-06-10 12:21:32 -04:00
Mike Shal eec103d849 Bug 846634 - Part 2: Move EXPORTS to moz.build; r=joey 2013-04-16 15:24:43 -04:00
Kyle Machulis 331f36baa9 Bug 855465 - Add emacs python mode comments to moz.build files; r=gps 2013-04-01 11:36:59 -07:00
Kyle Machulis ec9b53db93 Backout for changeset 03452b187c14 (Bug 855465) due to bustage on a CLOSED TREE; r=qdot 2013-03-29 15:12:58 -07:00
Kyle Machulis 0419a0b889 Bug 855465 - Add emacs python mode comments to moz.build files; r=gps 2013-03-29 13:56:18 -07:00
Mike Shal 24be52d653 Bug 844654 - Part 2: Move MODULE to moz.build; rs=gps 2013-03-19 11:47:00 -07:00
Gregory Szorc db19ba72e6 Bug 784841 - Part 18y: Convert /modules; r=glandium 2013-02-25 12:47:23 -08:00
Mike Hommey c7bc993e33 Bug 838165 - Cleanup in NSPR hooking in the build system. r=ted 2013-02-14 08:25:43 +01:00
Nathan Froyd cc93814d66 Bug 798564 - remove prtypes.h #includes in modules/libmar/; r=ehsan 2013-01-23 16:36:59 -05:00
Trevor Saunders a2fa482561 backout an accidental change that landed with bug 817133 2012-12-05 20:35:09 -05:00
Trevor Saunders 5758645a73 bug 817133 - move platform init and shutdown stuff out of nsAccessNodeWrap and ApplicationAccessibleWrap static methods r=surkov 2012-12-01 19:58:25 -05:00
Brian R. Bondy d96d6aa2ac Bug 798415 - Import signature to MAR files implementation. r=bsmith 2012-10-17 09:39:44 -04:00
Brian R. Bondy 644afa0442 Bug 798413 - Export signature from MAR files implementation. r=bsmith 2012-10-17 09:39:44 -04:00
Brian R. Bondy 51b257b785 Bug 792452 - Base implementation for multiple signing and verifying. r=bsmith 2012-10-17 09:39:44 -04:00
Ehsan Akhgari 9ce84aec84 Bug 579517 - Part 5: Add missing StandardInteger.h #includes where needed; r=bsmedberg
Landing on a CLOSED TREE
2012-08-08 17:08:17 -04:00
Ehsan Akhgari 243c878d26 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Mike Hommey 0f9f294ea0 Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
Gervase Markham cb6a072c2a Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Nathan Froyd c8e3762c81 Bug 739958 - fix compiler warnings in libmar; r=bbondy 2012-03-28 09:03:17 -04:00
Brian R. Bondy 6714e6a3f2 Bug 720688 - Ability to strip MAR signatures in libmar. r=rstrong 2012-02-24 16:29:42 -05:00
Brian R. Bondy 4e9aab5fd0 Bug 708690 - libmar enhancements for product information blocks. r=rstrong 2012-02-24 16:29:41 -05:00
Brian R. Bondy caf84f7641 Bug 699700 - Add support for signing and verifying MAR files in libmar and the mar program. r=bsmith 2012-02-24 16:29:41 -05:00
Ed Morley c04da8ec1b Bug 655039 - Remove WinCE code from libmar; r=rstrong 2011-05-05 17:14:43 -04:00
Justin Dolske bddf6a8349 Bug 533665 - Avoid the need to build NSPR for L10N repacks. r=robert.bugzilla a192=beltzner 2009-12-09 14:59:37 -08:00
Hiroyuki Ikezoe 0cfababd78 Bug 488807 - Should close the handle of FindFirstFile. r=blassey, sr=bsmedberg 2009-06-15 11:58:25 +02:00
Brad Lassey c94543815a Bug 479382 - libmar doesn't build on windows ce (uses posix file io); r=benjamin 2009-03-15 14:59:59 +01:00