mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2026-04-09 13:32:31 +02:00
Add missing range checks to pdfioArrayCopy and pdfioDictCopy.
This commit is contained in:
@@ -12,7 +12,9 @@ v1.6.2 - YYYY-MM-DD
|
|||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
- Increased the maximum length of a single string to 128k (Issue #146)
|
- Increased the maximum length of a single string to 128k (Issue #146)
|
||||||
|
- Added missing range checks to `pdfioArrayCopy` and `pdfioDictCopy`.
|
||||||
- Fixed an error propagation bug when reading too-long values (Issue #146)
|
- Fixed an error propagation bug when reading too-long values (Issue #146)
|
||||||
|
- Fixed a Clang warning.
|
||||||
|
|
||||||
|
|
||||||
v1.6.1 - 2025-12-26
|
v1.6.1 - 2025-12-26
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// PDF array functions for PDFio.
|
// PDF array functions for PDFio.
|
||||||
//
|
//
|
||||||
// Copyright © 2021-2024 by Michael R Sweet.
|
// Copyright © 2021-2026 by Michael R Sweet.
|
||||||
//
|
//
|
||||||
// Licensed under Apache License v2.0. See the file "LICENSE" for more
|
// Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||||
// information.
|
// information.
|
||||||
@@ -264,6 +264,10 @@ pdfioArrayCopy(pdfio_file_t *pdf, // I - PDF file
|
|||||||
|
|
||||||
PDFIO_DEBUG("pdfioArrayCopy(pdf=%p, a=%p(%p))\n", (void *)pdf, (void *)a, a ? (void *)a->pdf : NULL);
|
PDFIO_DEBUG("pdfioArrayCopy(pdf=%p, a=%p(%p))\n", (void *)pdf, (void *)a, a ? (void *)a->pdf : NULL);
|
||||||
|
|
||||||
|
// Range check input...
|
||||||
|
if (!pdf || !a)
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
// Create the new array...
|
// Create the new array...
|
||||||
if ((na = pdfioArrayCreate(pdf)) == NULL)
|
if ((na = pdfioArrayCreate(pdf)) == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|||||||
@@ -79,6 +79,10 @@ pdfioDictCopy(pdfio_file_t *pdf, // I - PDF file
|
|||||||
|
|
||||||
PDFIO_DEBUG("pdfioDictCopy(pdf=%p, dict=%p(%p))\n", (void *)pdf, (void *)dict, dict ? (void *)dict->pdf : NULL);
|
PDFIO_DEBUG("pdfioDictCopy(pdf=%p, dict=%p(%p))\n", (void *)pdf, (void *)dict, dict ? (void *)dict->pdf : NULL);
|
||||||
|
|
||||||
|
// Range check input...
|
||||||
|
if (!pdf || !dict)
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
// Create the new dictionary...
|
// Create the new dictionary...
|
||||||
if ((ndict = pdfioDictCreate(pdf)) == NULL)
|
if ((ndict = pdfioDictCreate(pdf)) == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user