Age | Commit message (Collapse) | Author |
|
There are places where an object "child" has a raw pointer
back to object "owner" with the understanding that owner will
always outlive child.
Violating this constraint can lead to use after free, but this
requires finding two paths: one that frees the objects in the
wrong order, and one that uses the object after the free. The
purpose of this patch is to detect the constraint violation
even when the second path is not hit.
We create a template that is used in place of TYPE*. It's dtor,
when a memory tool is present, goes out and probes the first
byte of the object to which it points. Used in "child", this
allows the memory tool to prove that the "owner" is still alive
at the time the child is destroyed, and hence the constraint is
never violated.
Change-Id: I2a6d696d51dda4a79ee2f00a6752965e058a6417
Reviewed-on: https://pdfium-review.googlesource.com/5475
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This Cl allows passing a CFX_ByteStringC to IFX_WriteStream along with the
buffer method. This makes it easier to pass C-style strings to the stream.
Change-Id: I1051eb3ba17c7fbd42984c14dc60cbce24d72f3f
Reviewed-on: https://pdfium-review.googlesource.com/5430
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Ibd8d70264d79afc0baabaa5093aceb21ee777196
Reviewed-on: https://pdfium-review.googlesource.com/5334
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl moves the implementation of the archive buffer behind an
IFX_ArchiveStream interface. The buffer holds the current offset and the
offset parameter is removed from the CPDF_Creator and various other
methods.
Change-Id: Ia54e803b58bbfb6ef03fec4a940d2c056d541356
Reviewed-on: https://pdfium-review.googlesource.com/5255
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl conslidates if statements, converts int returns to bools where
possible and various other cleanups in fpdfapi/edit.
Change-Id: Ia31ecc69843117eb5ebfff449a6046a267d08e89
Reviewed-on: https://pdfium-review.googlesource.com/5190
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I84cd8e91a296119ecf80b7a092b886f291bebb45
Reviewed-on: https://pdfium-review.googlesource.com/4953
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
They should each know what they are rather than having an
external ChildRecord struct to track the type.
Change-Id: Ic647ba45569764073e944d30af1a96dccdc29eb3
Reviewed-on: https://pdfium-review.googlesource.com/5210
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Layering prevents the (newly-moved) CFX_Char from knowing about
this class, so some casting is still required.
Change-Id: I5b7556fdfa80d09e5116b171b01ab5e707763bf0
Reviewed-on: https://pdfium-review.googlesource.com/5172
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:667
Change-Id: I811571c334ff28162905a65781ca14f03caf2966
Reviewed-on: https://pdfium-review.googlesource.com/4910
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
- FXSYS_toDecimalDigit() becomes FXSYS_DecimalCharToInt().
- FXSYS_toHexDigit() becomes FXSYS_HexCharToInt().
Change-Id: If4683e8f85f05124b92ff075056cbc295442087d
Reviewed-on: https://pdfium-review.googlesource.com/4930
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL removes the CFX_CharMap class and moves the two static methods
into the files in which they're used.
Change-Id: I8ff7cbfd7f1ef3970e39c77ffa3439099f7fec02
Reviewed-on: https://pdfium-review.googlesource.com/4873
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl cleans up more IFX_Pause parameters which are always null.
Change-Id: Ia48600f06216db64a2db8e6e97222a91bd4ba149
Reviewed-on: https://pdfium-review.googlesource.com/4890
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
No code needs this execpt one file.
Change-Id: Ibceb33259f5a3635de36a272ebd49ef572004cbc
Reviewed-on: https://pdfium-review.googlesource.com/4832
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I612d9eaa47f6e4b023a49ab9120372de3d73cdc7
Reviewed-on: https://pdfium-review.googlesource.com/4831
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Many of these are already unique_ptrs.
Change-Id: I3695d4ff5a8f7483ad994ac7657897fd55069cd5
Reviewed-on: https://pdfium-review.googlesource.com/4690
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I801f3cf11a27f91fa3e75518143f953050b2f607
Reviewed-on: https://pdfium-review.googlesource.com/4650
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
BUG=chromium:716526
Change-Id: Idbe4624ab2193cee2931c69ed023dd2c1679d124
Reviewed-on: https://pdfium-review.googlesource.com/4615
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Otherwise, the top byte will be unitialized. We later mask it off,
but MSAN isn't clever enough to realize this.
Bug: 716207
Change-Id: Ic4513bbaee6a47654392580d5f404195da4a6509
Reviewed-on: https://pdfium-review.googlesource.com/4591
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I13b43ceafc6a35bcc1e366546a4a408ea01fe4ab
Reviewed-on: https://pdfium-review.googlesource.com/4534
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This Cl adds some unit tests for the CFX_Matrix Reverse method.
Bug: chromium:702041
Change-Id: I9598d3eb48d6b86a3e192d313fe1091bd29a4701
Reviewed-on: https://pdfium-review.googlesource.com/4492
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl adds a simple comment to CFX_Matrix to record which positions in
the 3x3 matrix each of the letters denotes.
Change-Id: Ie733657e6072e2148406d43f06fbd883b34bf573
Reviewed-on: https://pdfium-review.googlesource.com/4490
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I769d7f2c52b0a0db36be6145bfb626c126a58be9
Reviewed-on: https://pdfium-review.googlesource.com/4480
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Its contents are delcared in fx_coordinates.h
Remove unused GetIntersection().
Move FXSYS_round to fx_system.cpp.
Change-Id: I70749581d1321dd919e35fa2daab9591098f68e9
Reviewed-on: https://pdfium-review.googlesource.com/4479
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Prevent implicit construction of CFX_WideString from non-wchar_t
variables. Similarly prevent implicit construction of CFX_ByteString
from non-char variables.
Fix up CBC_OnedCodaBarWriter which tries to do the above, and simplify
code there using pdfium::ContainsValue(). Same for CPDF_FileSpec.
Change-Id: I3db7125a68ef3f64c2f235d38e974767cd083dc3
Reviewed-on: https://pdfium-review.googlesource.com/4478
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Iba1aa793567e69acc3cc1acbd5b9a9f531c80b7a
Reviewed-on: https://pdfium-review.googlesource.com/4453
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Bug: 712725
Change-Id: I3384385176410964a87b12c2587f68247ea80cc9
Reviewed-on: https://pdfium-review.googlesource.com/4454
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
We must initialize our partition allocator before calling into
any test cases.
We can then remove the FPDF_Test class, which did the same thing.
Change-Id: I614480fa474b2032052857a02e94781f15a27a4e
Reviewed-on: https://pdfium-review.googlesource.com/4473
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit fbd9ea1db2f1bb7fa006e7304a1202afc683c142.
Reason for revert: This check seems too strict
BUG=chromium:714187
Original change's description:
> Compare to epsilon instead of 0 in CFX_Matrix::SetReverse
>
> Since we are going to divide i by 0, it is better to compare it to epsilon
> and avoid wonkiness from division by something too close to 0.
>
> BUG=chromium:702041
>
> Change-Id: I8136d6063f8debd41cef37eaab7e4097b3f32f4b
> Reviewed-on: https://pdfium-review.googlesource.com/3090
> Commit-Queue: Nicolás Peña <npm@chromium.org>
> Reviewed-by: dsinclair <dsinclair@chromium.org>
>
TBR=tsepez@chromium.org,dsinclair@chromium.org,npm@chromium.org,pdfium-reviews@googlegroups.com
# Not skipping CQ checks because original CL landed > 1 day ago.
BUG=chromium:702041
Change-Id: Ia7d933fd3d8ce4957788341463866a04679d7f2b
Reviewed-on: https://pdfium-review.googlesource.com/4432
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
Replace other one-off implementations as well.
Change-Id: I2878f3fae479c12b7de5234ee3a26477d602d14d
Reviewed-on: https://pdfium-review.googlesource.com/4398
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Convert IsXMLNameChar() to static method for easier testing
without namespace pollution.
Change-Id: I004557e74fde94d3582b0a2326e5e68b907b9690
Reviewed-on: https://pdfium-review.googlesource.com/4397
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The CFX_MemoryStream is the only implementation of IFX_MemoryStream.
This CL removes the interfaces and uses CFX_MemoryStream directly.
Change-Id: I2f43fa39e82dafa7673517d214ae15fd2d0df331
Reviewed-on: https://pdfium-review.googlesource.com/4391
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl consolidates the stream code into fx_stream.
Change-Id: I22a250b4ca6e342592b81260d2a918ebab7f60a2
Reviewed-on: https://pdfium-review.googlesource.com/4373
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL cleans up the fx_extension file. The stream code was moved to
fx_stream. IFX_FileAccess was removed and CFX_CRTFileAccess split to its
own file. Code shuffled from header to cpp file.
Change-Id: I700fdfcc9797cf4e8050cd9ba010ad8854feefbf
Reviewed-on: https://pdfium-review.googlesource.com/4371
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl converts the Clone method of IFX_CharIter to return a
unique_ptr. The usages were all converting to a unique_ptr already.
Change-Id: I1ca5ddd03eca8f21d616efb2b92fb27899c43c23
Reviewed-on: https://pdfium-review.googlesource.com/4351
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl cleans up the unused defines in fx_codepage.h. The
FXFONT_CHARSET_ defines are replaced with fx_codepage defines, this
moves fx_codepage into core instead of xfa only. Static asserts are
added to verify the public/ charsets match the fx_codepage charsets.
Change-Id: Ie2f749e093de60a9a6743128a1fb087912e4cc96
Reviewed-on: https://pdfium-review.googlesource.com/4316
Commit-Queue: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL moves the XML parser from FDE into FXCRT and renames to CFX_
from CFDE_.
Change-Id: I21a9590bf74daf5517df630d7e7a5de89da99ea4
Reviewed-on: https://pdfium-review.googlesource.com/4312
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL moves the FGAS stream code into core/fxcrt and renames to
CFX_SeekableStreamProxy.
Change-Id: I6641fe0cca45a128ef3ec281b0b40f8d60296387
Reviewed-on: https://pdfium-review.googlesource.com/4311
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Upstream commit:
https://github.com/vadz/libtiff/commit/d60332057b9575ada4f264489582b13e30137be1
Bug: chromium:711638
Change-Id: I46de1a00f9bb8d5de8df64ec78a9d62dcb4352ed
Reviewed-on: https://pdfium-review.googlesource.com/4310
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
The std methods assume that the input can be represented as unsigned char.
Bug: pdfium:703
Change-Id: I11d20869502aff0ebb8badca853398a7d0232338
Reviewed-on: https://pdfium-review.googlesource.com/4171
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the CXML_DataStmAcc class which was unused and moves the
CXML_DataBufAcc to a separate file. This removes the use of the
IFX_BufferedReadStream as the parent class and removes default
implemented methods.
Change-Id: I5a3921d5a6f882d54cc1c74305f1a777aa4cebfc
Reviewed-on: https://pdfium-review.googlesource.com/4292
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I85c8423c177fd7ecd5da90ef89419efc0f9cf44b
Reviewed-on: https://pdfium-review.googlesource.com/4262
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
The CFindFileDataW class is never used.
Change-Id: I230e1e1f2a5cc6a498ac104d156b9f685324a707
Reviewed-on: https://pdfium-review.googlesource.com/4293
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I40ec07c0da54bcf36c83fa26ff457cd4b98a91cf
Reviewed-on: https://pdfium-review.googlesource.com/4261
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Re-write to use std::vectors rather than self-managed buffers.
Includes test case that breaks before patch.
Formerly, we had two independent buffers whose position were
tracked by the same variable, assuming that only one was
being written to at a given time. This is a bad idea because
it's easy to forget to zero the index when switching buffers,
and start indexing into one using previously computed offsets
from the other.
Additionally, there were cases where the location of a partial
entity wasn't discarded when switching states thus clearing the
buffer tracking said entity.
Bug: 711459
Change-Id: I008f69517d4319a5fe8abda8d54c5b9975551697
Reviewed-on: https://pdfium-review.googlesource.com/4230
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Split off from a forthcoming CL to make it smaller.
Change-Id: I4409e8c7e87c0954a909e7c1dbeace9d4435b472
Reviewed-on: https://pdfium-review.googlesource.com/4259
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Make the pending re-write CL smaller, and back-fill some test.
Virtualize the handler interface so that it can be mocked.
Change-Id: Icbbc6b6789ba135b73c6fd1bbb90f5aae6ab7649
Reviewed-on: https://pdfium-review.googlesource.com/4250
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Pre-cursor to using more std::vector<uint8_t> as byte buffers.
The widestring test case is more complicated, where we're not sure
of having any particular uint*_t type to match wchar_t.
Change-Id: Ic27980f16cdbc61fac7c11f39a85eea58d19bacb
Reviewed-on: https://pdfium-review.googlesource.com/4153
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change pass by reference to const reference or pointer.
Change-Id: Ic007f14e6569679a846980a96cc627eac4ecd5d6
Reviewed-on: https://pdfium-review.googlesource.com/3953
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Also use safe arithmetic for two-arg ctor.
Change-Id: I5d541d9b2d5fe5b939f4cc8c22cf034f5cb01176
Reviewed-on: https://pdfium-review.googlesource.com/3955
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Tests need to be subclasses of FPDF_Test.
BUG=pdfium:700
Change-Id: I317ec2c49567e58cb57c6222e387574226f594b3
Reviewed-on: https://pdfium-review.googlesource.com/3890
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Chris Palmer <palmer@chromium.org>
|