Commit Graph

193 Commits

Author SHA1 Message Date
Peter Van der Beken
317063aa1e Bug 1754724 - Clear up even more computations in expat code. r=farre, a=tritter
Depends on D140166

Differential Revision: https://phabricator.services.mozilla.com/D140167
2022-03-02 22:34:28 +00:00
Peter Van der Beken
6431af8019 Bug 1754724 - Clear up some more computations in expat code. r=farre, a=tritter
Depends on D140165

Differential Revision: https://phabricator.services.mozilla.com/D140166
2022-03-02 22:22:08 +00:00
Peter Van der Beken
5876a3de0f Bug 1754724 - Clear up some computations in expat code. r=farre, a=tritter
Differential Revision: https://phabricator.services.mozilla.com/D140165
2022-03-02 22:18:23 +00:00
Bobby Holley
65ffce9728 Bug 1746996 - Ensure that storeRawNames is always called. r=peterv
To avoid copying in the common case, expat points directly into the
(internal) input buffer for strings referenced from the tag stack. When
expat unwinds back to the caller, it attempts to call storeRawNames() to
walk the tag stack and copy any such strings into persistent memory
before the caller potentially invokes XML_Parse() again and shuffles the
input buffer, thereby invalidating these references.

Unfortunately, it doesn't do it in all the right places. Because
different parsing states set |processor| to different callbacks (so that
parsing can resume in the right context), there are a number of
non-obvious entry points. In this case, the input stream was chunked so
that parsing paused in middle of processing an internal entity [1], so
|processor| was set to internalEntityProcessor(), which invokes
doContent() but does not call storeRawNames(). The doContent() call then
parsed some nested tags from the entity. Tags within an entity are
generally required to be balanced, but a host callback returned an error
code to interrupt parsing midway through. This caused Expat to return to
the caller with a tag stack still referencing the input buffer, which
got clobbered in the next call to XML_Parse, causing a tag mismatch on
the next close tag.

Conceptually, this optimization should be managed by doContent(), and I
believe the only reason that isn't the case is that doContent() has so
many return paths (and we don't have RAII in C). We can fix this by
wrapping doContent() in a helper.

[1] &certerror.expiredCert.whatCanYouDoAboutIt2;

Differential Revision: https://phabricator.services.mozilla.com/D134878
2022-01-01 05:00:45 +00:00
Shravan Narayan
1cc3caab38 Bug 1743007 - Convert expat XML_StopParser API to take an int param instead of u8 r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D132171
2021-11-25 21:02:10 +00:00
Deian Stefan
86e82e1036 Bug 1688452 - Retrofit nsExpatDriver to use RLBoxed libexpat r=tjr,peterv,bholley,glandium
Differential Revision: https://phabricator.services.mozilla.com/D104658
2021-11-22 06:19:17 +00:00
Sandor Molnar
51a05715fe Backed out changeset 4294063f1606 (bug 1688452) for causing mochitest and wpt failures. CLOSED TREE 2021-11-20 13:00:27 +02:00
Deian Stefan
fcd2e09518 Bug 1688452 - Retrofit nsExpatDriver to use RLBoxed libexpat r=tjr,peterv,bholley,glandium
Differential Revision: https://phabricator.services.mozilla.com/D104658
2021-11-19 21:28:53 +00:00
Alexandru Michis
d4f3d0994e Backed out changeset 7893bbd002e0 (bug 1688452) for causing bustages in nsRLBoxExpatDriver.
CLOSED TREE
2021-11-19 15:54:31 +02:00
Deian Stefan
76c5d8907d Bug 1688452 - Retrofit nsExpatDriver to use RLBoxed libexpat r=tjr,peterv,bholley,glandium
Differential Revision: https://phabricator.services.mozilla.com/D104658
2021-11-19 06:08:36 +00:00
Cosmin Sabou
0d612db0fb Backed out 4 changesets (bug 1688452) for assertion and bc failures on browser_translation_bing.js.
Backed out changeset 1a720cffc019 (bug 1688452)
Backed out changeset 797a7e243d43 (bug 1688452)
Backed out changeset 00fd325069fa (bug 1688452)
Backed out changeset 23ef68478e93 (bug 1688452)
2021-09-29 20:13:33 +03:00
Deian Stefan
20476da693 Bug 1688452 - Part 4: Add Wasm sandbox support for RLBoxed libexpat r=tjr
Depends on D126369

Differential Revision: https://phabricator.services.mozilla.com/D106254
2021-09-29 14:31:45 +00:00
Simon Giesecke
760cc7e936 Bug 1679522 - Fix include directives and forward declarations. r=andi,necko-reviewers,jgilbert
- Add missing include directives and forward declarations.
- Remove some extra include directives.
- Add missing namespace qualifications.
- Move include directives out of namespace in toolkit/xre/GlobalSemaphore.h

Differential Revision: https://phabricator.services.mozilla.com/D98894
2021-03-25 10:19:44 +00:00
Peter Van der Beken
baaea5c0bc Bug 1584907 - Deny internal entities closing the doctype. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D47704

--HG--
extra : moz-landing-system : lando
2019-10-04 09:38:58 +00:00
Peter Van der Beken
3991c12564 Bug 1539759 - Improve DTD entity handling. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D30248

--HG--
extra : moz-landing-system : lando
2019-05-21 18:24:02 +00:00
Mihai Alexandru Michis
8187c0826d Backed out changeset 16c03995ac55 (bug 1539759) for causing Buffer Overflow in nsExpatDriver.cpp
--HG--
extra : rebase_source : 0b9e64681becc725d8550f4a6820166ce8fba2bf
2019-05-13 18:16:39 +03:00
Peter Van der Beken
068b07cee6 Bug 1539759 - Improve DTD entity handling. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D30248

--HG--
extra : moz-landing-system : lando
2019-05-13 07:32:42 +00:00
Cosmin Sabou
58c0da101a Backed out changeset 03166449953f (bug 1539759) on request from past for causing bug 1548990. CLOSED TREE 2019-05-04 11:02:30 +03:00
Gijs Kruitbosch
c1c14ab7ad Bug 1539759 - improve DTD entity handling, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D27904

--HG--
extra : moz-landing-system : lando
2019-05-03 09:13:58 +00:00
Narcis Beleuzu
c8e45a1834 Backed out changeset 4c6e2e3f23f9 (bug 1539759) for failures on nsExpatDriver::WillBuildModel . CLOSED TREE 2019-05-02 13:42:29 +03:00
Gijs Kruitbosch
54d985d143 Bug 1539759 - improve DTD entity handling, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D27904

--HG--
extra : moz-landing-system : lando
2019-05-02 09:22:10 +00:00
Oana Pop Rus
594cead134 Backed out changeset 5f451bcec205 (bug 1539759) for build bustages in nsExpatDriver.cpp on a CLOSED TREE 2019-05-02 11:52:32 +03:00
Gijs Kruitbosch
170118c247 Bug 1539759 - improve DTD entity handling, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D27904

--HG--
extra : moz-landing-system : lando
2019-05-02 08:19:08 +00:00
Mike Hommey
e6ab5d959a Bug 1516642 - Add a function declaration for arc4random_buf in expat. r=peterv
The function has been in bionic (Android's libc since the first commit
in the upstream repository), but it's not been in stdlib.h until
recently. As it happens, we have a similar declaration in
xpcom/base/nsUUIDGenerator.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D19120

--HG--
extra : moz-landing-system : lando
2019-02-08 13:48:36 +00:00
Peter Van der Beken
eb86fefb02 Bug 1374012 - Update to Expat 2.2.1. Part 18: various miscellaneous changes. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14457

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:26 +00:00
Peter Van der Beken
7a603b28e7 Bug 1374012 - Update to Expat 2.2.1. Part 17: add/change APIs that are not used in Gecko. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14456

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:25 +00:00
Peter Van der Beken
0e027c70be Bug 1374012 - Update to Expat 2.2.1. Part 16: fix some issues with various compilers. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14455

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:24 +00:00
Peter Van der Beken
cf5d21461b Bug 1374012 - Update to Expat 2.2.1. Part 15: ifdef some constants so they are only defined when used. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14454

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:23 +00:00
Peter Van der Beken
e88d24ea11 Bug 1374012 - Update to Expat 2.2.1. Part 14: Annotate memory allocators for GCC. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14453

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:22 +00:00
Peter Van der Beken
18fcb94d9e Bug 1374012 - Update to Expat 2.2.1. Part 13: Tidy up attribute prefix bindings on error. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14452

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:21 +00:00
Peter Van der Beken
5793b635bc Bug 1374012 - Update to Expat 2.2.1. Part 12: Address warning "missing initializer for field". r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14451

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:20 +00:00
Peter Van der Beken
a3204ff408 Bug 1374012 - Update to Expat 2.2.1. Part 11: Changes to defines for various compilers. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14450

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:19 +00:00
Peter Van der Beken
f652ec9604 Bug 1374012 - Update to Expat 2.2.1. Part 10: Take into account that CHAR_MATCHES may read >1 bytes. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14449

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:18 +00:00
Peter Van der Beken
e0c4b31e3c Bug 1374012 - Update to Expat 2.2.1. Part 9: Make XmlConvert return errors. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14448

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:17 +00:00
Peter Van der Beken
7afc61faae Bug 1374012 - Update to Expat 2.2.1. Part 8: Validate parser argument in various APIs. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14447

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:16 +00:00
Peter Van der Beken
90a42151df Bug 1374012 - Update to Expat 2.2.1. Part 7: Add __unused__ anotations. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14446

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:16 +00:00
Peter Van der Beken
bebd150ad3 Bug 1374012 - Update to Expat 2.2.1. Part 6: Add XML_ATTR_INFO code which we don't enable. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14445

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:15 +00:00
Peter Van der Beken
6a0c98bfbf Bug 1374012 - Update to Expat 2.2.1. Part 5: Use ASCII_* instead of literal characters. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14444

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:14 +00:00
Peter Van der Beken
cc52d0e9e6 Bug 1374012 - Update to Expat 2.2.1. Part 4: removing mainlined customisations and merge whitespace changes. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14443

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:13 +00:00
Peter Van der Beken
650f9e44c2 Bug 1374012 - Update to Expat 2.2.1. Part 3: Reject invalid DTD. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14442

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:12 +00:00
Peter Van der Beken
177f23f661 Bug 1374012 - Update to Expat 2.2.1. Part 2b: cherry-pick compilation fix from 2.2.2. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14441

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:11 +00:00
Peter Van der Beken
05221a9c4c Bug 1374012 - Update to Expat 2.2.1. Part 2a: Better hashing. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14440

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:11 +00:00
Peter Van der Beken
f9a10464ec Bug 1374012 - Update to Expat 2.2.1. Part 1: More correct calculations. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D14439

--HG--
extra : moz-landing-system : lando
2018-12-27 15:13:10 +00:00
Peter Van der Beken
f87fcac9f4 Bug 569229 - Close outer entities when they're parsed even if we're blocking the parser. r=erahm.
--HG--
extra : rebase_source : 174edac48b2d6b52dc9fe3ad289de735695c65be
extra : source : e86a8b867c7578e082d572403753b3feaf75b0de
2016-09-06 15:24:06 +02:00
Aryeh Gregor
3b1cc7049b Bug 1298818 - Port test_bug411103.html to wpt; r=jst
This allows other UAs to use it, removes duplicated checks, and
increases the chance of us noticing if the spec changes.  Some of the
expected values in our mochitest were contrary to the spec.

I checked the new expected failures against the spec and the other UAs.
I filed a spec bug for one group because it was contrary to all UAs
(although IMO the spec makes more sense and the UAs are buggy), and the
others are fixed in the next patch.

MozReview-Commit-ID: 1j11XgfuErB
2016-10-26 16:49:36 +03:00
Phil Ringnalda
3582398bc9 Backed out 3 changesets (bug 1298818, bug 1299838) for invalid wpt log messages
CLOSED TREE

Backed out changeset 5c65378feacd (bug 1298818)
Backed out changeset 72f66ce70dd8 (bug 1298818)
Backed out changeset eb17677e8167 (bug 1299838)
2016-09-01 18:59:36 -07:00
Aryeh Gregor
00d6f39ca3 Bug 1298818 - Throw correct exception for names that start with Unicode characters that are only allowed at start; r=jst
The new behavior matches the specification, web-platform-tests, Chrome,
and Edge.  I couldn't figure out any reason for the old behavior.

MozReview-Commit-ID: 6cktZuN1vCV
2016-09-01 20:37:35 +03:00
Tom Tromey
5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Eric Rahm
b2ddb18a6f Bug 1274777 - Check for oveflow. r=peterv 2016-06-08 13:54:05 -07:00
Eric Rahm
5e7354d86b Bug 1236923 - Check int for overflow. r=peterv 2016-05-21 10:05:05 -07:00