From c4a6d70eca5bdecd2db243231cfd1a1d93a28411 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Thu, 26 Mar 2020 15:01:10 +0100 Subject: [PATCH] netpbm: update to 10.90.0. --- .../netpbm/files/netpbm-security-code.patch | 165 +----------------- srcpkgs/netpbm/template | 10 +- 2 files changed, 6 insertions(+), 169 deletions(-) diff --git a/srcpkgs/netpbm/files/netpbm-security-code.patch b/srcpkgs/netpbm/files/netpbm-security-code.patch index ca74b96dff9..993917b923f 100644 --- a/srcpkgs/netpbm/files/netpbm-security-code.patch +++ b/srcpkgs/netpbm/files/netpbm-security-code.patch @@ -69,65 +69,6 @@ diff -up netpbm-10.58.01/converter/other/pnmtoddif.c.security-code netpbm-10.58. ip.bytes_per_line = 3 * cols; ip.bits_per_pixel = 24; ip.spectral = 5; -diff -up netpbm-10.58.01/converter/other/pnmtojpeg.c.security-code netpbm-10.58.01/converter/other/pnmtojpeg.c ---- netpbm-10.58.01/converter/other/pnmtojpeg.c.security-code 2012-04-09 15:31:39.000000000 +0200 -+++ netpbm-10.58.01/converter/other/pnmtojpeg.c 2012-04-09 15:40:03.186620002 +0200 -@@ -605,7 +605,11 @@ read_scan_script(j_compress_ptr const ci - want JPOOL_PERMANENT. - */ - const unsigned int scan_info_size = nscans * sizeof(jpeg_scan_info); -- jpeg_scan_info * const scan_info = -+ const jpeg_scan_info * scan_info; -+ -+ overflow2(nscans, sizeof(jpeg_scan_info)); -+ -+ scan_info = - (jpeg_scan_info *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - scan_info_size); -@@ -937,6 +941,8 @@ compute_rescaling_array(JSAMPLE ** const - const long half_maxval = maxval / 2; - long val; - -+ overflow_add(maxval, 1); -+ overflow2(maxval+1, sizeof(JSAMPLE)); - *rescale_p = (JSAMPLE *) - (cinfo.mem->alloc_small) ((j_common_ptr) &cinfo, JPOOL_IMAGE, - (size_t) (((long) maxval + 1L) * -@@ -1015,6 +1021,7 @@ convert_scanlines(struct jpeg_compress_s - */ - - /* Allocate the libpnm output and compressor input buffers */ -+ overflow2(cinfo_p->image_width, cinfo_p->input_components); - buffer = (*cinfo_p->mem->alloc_sarray) - ((j_common_ptr) cinfo_p, JPOOL_IMAGE, - (unsigned int) cinfo_p->image_width * cinfo_p->input_components, -diff -up netpbm-10.58.01/converter/other/pnmtops.c.security-code netpbm-10.58.01/converter/other/pnmtops.c ---- netpbm-10.58.01/converter/other/pnmtops.c.security-code 2012-04-09 15:31:40.000000000 +0200 -+++ netpbm-10.58.01/converter/other/pnmtops.c 2012-04-09 15:40:03.187619989 +0200 -@@ -256,17 +256,21 @@ parseCommandLine(int argc, const char ** - validateCompDimension(width, 72, "-width value"); - validateCompDimension(height, 72, "-height value"); - -+ overflow2(width, 72); - cmdlineP->width = width * 72; -+ overflow2(height, 72); - cmdlineP->height = height * 72; - - if (imagewidthSpec) { - validateCompDimension(imagewidth, 72, "-imagewidth value"); -+ overflow2(imagewidth, 72); - cmdlineP->imagewidth = imagewidth * 72; - } - else - cmdlineP->imagewidth = 0; - if (imageheightSpec) { -- validateCompDimension(imagewidth, 72, "-imageheight value"); -+ validateCompDimension(imageheight, 72, "-imageheight value"); -+ overflow2(imageheight, 72); - cmdlineP->imageheight = imageheight * 72; - } - else diff -up netpbm-10.58.01/converter/other/pnmtorle.c.security-code netpbm-10.58.01/converter/other/pnmtorle.c --- netpbm-10.58.01/converter/other/pnmtorle.c.security-code 2012-04-09 15:31:42.000000000 +0200 +++ netpbm-10.58.01/converter/other/pnmtorle.c 2012-04-09 15:40:03.188619976 +0200 @@ -812,29 +753,6 @@ diff -up netpbm-10.58.01/editor/pnmscalefixed.c.security-code netpbm-10.58.01/ed sxscale = SCALE * newcols / cols; syscale = SCALE * newrows / rows; -diff -up netpbm-10.58.01/editor/pnmshear.c.security-code netpbm-10.58.01/editor/pnmshear.c ---- netpbm-10.58.01/editor/pnmshear.c.security-code 2012-04-09 15:31:33.000000000 +0200 -+++ netpbm-10.58.01/editor/pnmshear.c 2012-04-09 15:40:03.224619526 +0200 -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include "pm_c_util.h" - #include "ppm.h" -@@ -236,6 +237,11 @@ main(int argc, char * argv[]) { - - shearfac = fabs(tan(cmdline.angle)); - -+ if(rows * shearfac >= INT_MAX-1) -+ pm_error("image too large"); -+ -+ overflow_add(rows * shearfac, cols+1); -+ - newcols = rows * shearfac + cols + 0.999999; - - pnm_writepnminit(stdout, newcols, rows, newmaxval, newformat, 0); diff -up netpbm-10.58.01/editor/ppmdither.c.security-code netpbm-10.58.01/editor/ppmdither.c --- netpbm-10.58.01/editor/ppmdither.c.security-code 2012-04-09 15:31:33.000000000 +0200 +++ netpbm-10.58.01/editor/ppmdither.c 2012-04-09 15:40:03.224619526 +0200 @@ -862,18 +780,6 @@ diff -up netpbm-10.58.01/editor/specialty/pamoil.c.security-code netpbm-10.58.01 MALLOCARRAY(hist, inpam.maxval + 1); if (hist == NULL) pm_error("Unable to allocate memory for histogram."); -diff -up netpbm-10.58.01/lib/libpammap.c.security-code netpbm-10.58.01/lib/libpammap.c ---- netpbm-10.58.01/lib/libpammap.c.security-code 2012-04-09 15:31:38.000000000 +0200 -+++ netpbm-10.58.01/lib/libpammap.c 2012-04-09 15:40:03.228619477 +0200 -@@ -104,6 +104,8 @@ allocTupleIntListItem(struct pam * const - */ - struct tupleint_list_item * retval; - -+ overflow2(pamP->depth, sizeof(sample)); -+ overflow_add(sizeof(*retval)-sizeof(retval->tupleint.tuple), pamP->depth*sizeof(sample)); - unsigned int const size = - sizeof(*retval) - sizeof(retval->tupleint.tuple) - + pamP->depth * sizeof(sample); diff -up netpbm-10.58.01/lib/libpm.c.security-code netpbm-10.58.01/lib/libpm.c --- netpbm-10.58.01/lib/libpm.c.security-code 2012-04-09 15:31:38.000000000 +0200 +++ netpbm-10.58.01/lib/libpm.c 2012-04-09 15:40:03.229619464 +0200 @@ -1047,76 +953,7 @@ diff -up netpbm-10.58.01/urt/rle.h.security-code netpbm-10.58.01/urt/rle.h /* Declare RLE library routines. */ -diff -up netpbm-10.58.01/urt/rle_open_f.c.security-code netpbm-10.58.01/urt/rle_open_f.c ---- netpbm-10.58.01/urt/rle_open_f.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/urt/rle_open_f.c 2012-04-09 15:40:03.234619402 +0200 -@@ -163,65 +163,7 @@ dealWithSubprocess(const char * const f - FILE ** const fpP, - bool * const noSubprocessP, - const char ** const errorP) { -- --#ifdef NO_OPEN_PIPES - *noSubprocessP = TRUE; --#else -- const char *cp; -- -- reapChildren(catchingChildrenP, pids); -- -- /* Real file, not stdin or stdout. If name ends in ".Z", -- * pipe from/to un/compress (depending on r/w mode). -- * -- * If it starts with "|", popen that command. -- */ -- -- cp = file_name + strlen(file_name) - 2; -- /* Pipe case. */ -- if (file_name[0] == '|') { -- pid_t thepid; /* PID from my_popen */ -- -- *noSubprocessP = FALSE; -- -- *fpP = my_popen(file_name + 1, mode, &thepid); -- if (*fpP == NULL) -- *errorP = "%s: can't invoke <<%s>> for %s: "; -- else { -- /* One more child to catch, eventually. */ -- if (*catchingChildrenP < MAX_CHILDREN) -- pids[(*catchingChildrenP)++] = thepid; -- } -- } else if (cp > file_name && *cp == '.' && *(cp + 1) == 'Z' ) { -- /* Compress case. */ -- pid_t thepid; /* PID from my_popen. */ -- const char * command; -- -- *noSubprocessP = FALSE; -- -- if (*mode == 'w') -- pm_asprintf(&command, "compress > %s", file_name); -- else if (*mode == 'a') -- pm_asprintf(&command, "compress >> %s", file_name); -- else -- pm_asprintf(&command, "compress -d < %s", file_name); -- -- *fpP = my_popen(command, mode, &thepid); -- -- if (*fpP == NULL) -- *errorP = "%s: can't invoke 'compress' program, " -- "trying to open %s for %s"; -- else { -- /* One more child to catch, eventually. */ -- if (*catchingChildrenP < MAX_CHILDREN) -- pids[(*catchingChildrenP)++] = thepid; -- } -- pm_strfree(command); -- } else { -- *noSubprocessP = TRUE; -- *errorP = NULL; -- } --#endif - } - - -diff -up netpbm-10.58.01/urt/rle_putcom.c.security-code netpbm-10.58.01/urt/rle_putcom.c +diff -up netpbm-9.58.01/urt/rle_putcom.c.security-code netpbm-10.58.01/urt/rle_putcom.c --- netpbm-10.58.01/urt/rle_putcom.c.security-code 2012-04-09 15:31:45.000000000 +0200 +++ netpbm-10.58.01/urt/rle_putcom.c 2012-04-09 15:40:03.234619402 +0200 @@ -14,6 +14,8 @@ diff --git a/srcpkgs/netpbm/template b/srcpkgs/netpbm/template index cedd69e6381..6309e89fe41 100644 --- a/srcpkgs/netpbm/template +++ b/srcpkgs/netpbm/template @@ -1,10 +1,10 @@ # Template file for 'netpbm' pkgname=netpbm # from http://svn.code.sf.net/p/netpbm/code/advanced/doc/HISTORY -version=10.89.01 +version=10.90.0 revision=1 -_githash=d566a34acc0a433487000bb3c1afae798858e43f -_githash_guide=d9bbf089cc1180650c6222cc4ce98c89c9ccb8b9 +_githash=b117a415aaf58c435805243a930e833f8cf62421 +_githash_guide=895e9c3897d592b7df1c579a9522185c826c3a36 create_wrksrc=yes build_wrksrc="netpbm-mirror-${_githash}" hostmakedepends="pkg-config perl python flex" @@ -16,8 +16,8 @@ license="BSD-3-Clause,GPL-2.0-only,custom:netpbm" homepage="http://netpbm.sourceforge.net/" distfiles="https://github.com/leahneukirchen/netpbm-mirror/archive/${_githash}.tar.gz https://github.com/leahneukirchen/netpbm-mirror/archive/${_githash_guide}.tar.gz" -checksum="2250bcadd1046822765e47726ebe042f638d37c2342e97e0c23006a6324cc2da - 18ba62f95f2d5bda3631d2cf00316da00bad6d148f3ac2cea175b9d15fadbcd9" +checksum="b13faeac847b48f51781b9fdd33111d48a3dd55c01e339b8845279927668f41f + 99c0b90815e3a624a58aa6d61d4488424967e3ead919c544cf6de48abb2f1355" post_extract() { cd $build_wrksrc