* [PR PATCH] zathura: backport (improved) upstream patch for buffer overflow
@ 2021-07-15 21:45 dkwo
2021-07-15 21:56 ` ericonr
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: dkwo @ 2021-07-15 21:45 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 377 bytes --]
There is a new pull request by dkwo against master on the void-packages repository
https://github.com/dkwo/void-packages zatmin
https://github.com/void-linux/void-packages/pull/31989
zathura: backport (improved) upstream patch for buffer overflow
Tested on x86_64-musl, fixes #31722
A patch file from https://github.com/void-linux/void-packages/pull/31989.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-zatmin-31989.patch --]
[-- Type: text/x-diff, Size: 2613 bytes --]
From 80b14fa659479ad7a0c75ab79f1cbb708bcd7e25 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 15 Jul 2021 23:41:30 +0200
Subject: [PATCH] zathura: backport (improved) upstream patch for buffer
overflow
---
.../zathura/patches/fix-buffer-overflow.patch | 27 +++++++++++++++++--
srcpkgs/zathura/template | 2 +-
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/srcpkgs/zathura/patches/fix-buffer-overflow.patch b/srcpkgs/zathura/patches/fix-buffer-overflow.patch
index f11b343b1845..8160ffa88e35 100644
--- a/srcpkgs/zathura/patches/fix-buffer-overflow.patch
+++ b/srcpkgs/zathura/patches/fix-buffer-overflow.patch
@@ -1,5 +1,5 @@
diff --git a/zathura/utils.c b/zathura/utils.c
-index b4b058f..6e1910e 100644
+index b4b058f..35abd6b 100644
--- a/zathura/utils.c
+++ b/zathura/utils.c
@@ -401,7 +401,7 @@ rectangle_to_points(void* vrect, void* vlist) {
@@ -7,7 +7,30 @@ index b4b058f..6e1910e 100644
static void
append_unique_uint(girara_list_t* list, const unsigned int v) {
- double* p = g_try_malloc(sizeof(v));
-+ double* p = g_try_malloc(sizeof(*p));
++ unsigned int* p = g_try_malloc(sizeof *p);
if (p == NULL) {
return;
}
+@@ -433,16 +433,16 @@ cut_rectangle(const zathura_rectangle_t* rect, girara_list_t* points, girara_lis
+ GIRARA_LIST_FOREACH_END(points, zathura_point_t*, i_pt, pt);
+
+ double x = ufloor(rect->x1);
+- GIRARA_LIST_FOREACH(xs, const double*, ix, cx)
++ GIRARA_LIST_FOREACH(xs, const unsigned int*, ix, cx)
+ double y = ufloor(rect->y1);
+- GIRARA_LIST_FOREACH(ys, const double*, iy, cy)
++ GIRARA_LIST_FOREACH(ys, const unsigned int*, iy, cy)
+ zathura_rectangle_t* r = g_try_malloc(sizeof(zathura_rectangle_t));
+ *r = (zathura_rectangle_t) {x, y, *cx, *cy};
+ y = *cy;
+ girara_list_append_unique(rectangles, cmp_rectangle, r);
+- GIRARA_LIST_FOREACH_END(ys, const double*, iy, cy);
++ GIRARA_LIST_FOREACH_END(ys, const unsigned int*, iy, cy);
+ x = *cx;
+- GIRARA_LIST_FOREACH_END(xs, const double*, ix, cx);
++ GIRARA_LIST_FOREACH_END(xs, const unsigned int*, ix, cx);
+
+ girara_list_free(xs);
+ girara_list_free(ys);
+--
+2.26.2
diff --git a/srcpkgs/zathura/template b/srcpkgs/zathura/template
index 5495c235fd99..54e869f539d0 100644
--- a/srcpkgs/zathura/template
+++ b/srcpkgs/zathura/template
@@ -1,7 +1,7 @@
# Template file for 'zathura'
pkgname=zathura
version=0.4.7
-revision=3
+revision=4
build_style=meson
configure_args="-Dsynctex=enabled"
hostmakedepends="pkg-config intltool python3-Sphinx desktop-file-utils
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: zathura: backport (improved) upstream patch for buffer overflow
2021-07-15 21:45 [PR PATCH] zathura: backport (improved) upstream patch for buffer overflow dkwo
@ 2021-07-15 21:56 ` ericonr
2021-07-15 21:56 ` ericonr
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ericonr @ 2021-07-15 21:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/31989#issuecomment-881037718
Comment:
Could you include a link to the upstream one in our patch?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: zathura: backport (improved) upstream patch for buffer overflow
2021-07-15 21:45 [PR PATCH] zathura: backport (improved) upstream patch for buffer overflow dkwo
2021-07-15 21:56 ` ericonr
@ 2021-07-15 21:56 ` ericonr
2021-07-16 8:17 ` [PR PATCH] [Updated] " dkwo
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ericonr @ 2021-07-15 21:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 202 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/31989#issuecomment-881037718
Comment:
Could you include a link to the upstream commit in our patch?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR PATCH] [Updated] zathura: backport (improved) upstream patch for buffer overflow
2021-07-15 21:45 [PR PATCH] zathura: backport (improved) upstream patch for buffer overflow dkwo
2021-07-15 21:56 ` ericonr
2021-07-15 21:56 ` ericonr
@ 2021-07-16 8:17 ` dkwo
2021-07-16 8:19 ` dkwo
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: dkwo @ 2021-07-16 8:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 382 bytes --]
There is an updated pull request by dkwo against master on the void-packages repository
https://github.com/dkwo/void-packages zatmin
https://github.com/void-linux/void-packages/pull/31989
zathura: backport (improved) upstream patch for buffer overflow
Tested on x86_64-musl, fixes #31722
A patch file from https://github.com/void-linux/void-packages/pull/31989.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-zatmin-31989.patch --]
[-- Type: text/x-diff, Size: 2747 bytes --]
From 619b40fd479dc4a30bb60df939307d1fb0ea17a3 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 15 Jul 2021 23:41:30 +0200
Subject: [PATCH] zathura: backport (improved) upstream patch for buffer
overflow
---
.../zathura/patches/fix-buffer-overflow.patch | 31 +++++++++++++++++--
srcpkgs/zathura/template | 2 +-
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/srcpkgs/zathura/patches/fix-buffer-overflow.patch b/srcpkgs/zathura/patches/fix-buffer-overflow.patch
index f11b343b1845..908b06b87c6f 100644
--- a/srcpkgs/zathura/patches/fix-buffer-overflow.patch
+++ b/srcpkgs/zathura/patches/fix-buffer-overflow.patch
@@ -1,5 +1,9 @@
+Taken from upstream
+https://git.pwmt.org/pwmt/zathura/-/commit/2713de2f6c810f5f0be3c179944867b5b07ddaed
+with a small correction
+
diff --git a/zathura/utils.c b/zathura/utils.c
-index b4b058f..6e1910e 100644
+index b4b058f..35abd6b 100644
--- a/zathura/utils.c
+++ b/zathura/utils.c
@@ -401,7 +401,7 @@ rectangle_to_points(void* vrect, void* vlist) {
@@ -7,7 +11,30 @@ index b4b058f..6e1910e 100644
static void
append_unique_uint(girara_list_t* list, const unsigned int v) {
- double* p = g_try_malloc(sizeof(v));
-+ double* p = g_try_malloc(sizeof(*p));
++ unsigned int* p = g_try_malloc(sizeof *p);
if (p == NULL) {
return;
}
+@@ -433,16 +433,16 @@ cut_rectangle(const zathura_rectangle_t* rect, girara_list_t* points, girara_lis
+ GIRARA_LIST_FOREACH_END(points, zathura_point_t*, i_pt, pt);
+
+ double x = ufloor(rect->x1);
+- GIRARA_LIST_FOREACH(xs, const double*, ix, cx)
++ GIRARA_LIST_FOREACH(xs, const unsigned int*, ix, cx)
+ double y = ufloor(rect->y1);
+- GIRARA_LIST_FOREACH(ys, const double*, iy, cy)
++ GIRARA_LIST_FOREACH(ys, const unsigned int*, iy, cy)
+ zathura_rectangle_t* r = g_try_malloc(sizeof(zathura_rectangle_t));
+ *r = (zathura_rectangle_t) {x, y, *cx, *cy};
+ y = *cy;
+ girara_list_append_unique(rectangles, cmp_rectangle, r);
+- GIRARA_LIST_FOREACH_END(ys, const double*, iy, cy);
++ GIRARA_LIST_FOREACH_END(ys, const unsigned int*, iy, cy);
+ x = *cx;
+- GIRARA_LIST_FOREACH_END(xs, const double*, ix, cx);
++ GIRARA_LIST_FOREACH_END(xs, const unsigned int*, ix, cx);
+
+ girara_list_free(xs);
+ girara_list_free(ys);
+--
+2.26.2
diff --git a/srcpkgs/zathura/template b/srcpkgs/zathura/template
index 5495c235fd99..54e869f539d0 100644
--- a/srcpkgs/zathura/template
+++ b/srcpkgs/zathura/template
@@ -1,7 +1,7 @@
# Template file for 'zathura'
pkgname=zathura
version=0.4.7
-revision=3
+revision=4
build_style=meson
configure_args="-Dsynctex=enabled"
hostmakedepends="pkg-config intltool python3-Sphinx desktop-file-utils
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: zathura: backport (improved) upstream patch for buffer overflow
2021-07-15 21:45 [PR PATCH] zathura: backport (improved) upstream patch for buffer overflow dkwo
` (2 preceding siblings ...)
2021-07-16 8:17 ` [PR PATCH] [Updated] " dkwo
@ 2021-07-16 8:19 ` dkwo
2021-07-16 20:25 ` [PR PATCH] [Merged]: " ericonr
2021-07-16 20:25 ` ericonr
5 siblings, 0 replies; 7+ messages in thread
From: dkwo @ 2021-07-16 8:19 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 188 bytes --]
New comment by dkwo on void-packages repository
https://github.com/void-linux/void-packages/pull/31989#issuecomment-881267458
Comment:
Done. I'll report the improvement upstream as well
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR PATCH] [Merged]: zathura: backport (improved) upstream patch for buffer overflow
2021-07-15 21:45 [PR PATCH] zathura: backport (improved) upstream patch for buffer overflow dkwo
` (3 preceding siblings ...)
2021-07-16 8:19 ` dkwo
@ 2021-07-16 20:25 ` ericonr
2021-07-16 20:25 ` ericonr
5 siblings, 0 replies; 7+ messages in thread
From: ericonr @ 2021-07-16 20:25 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 233 bytes --]
There's a merged pull request on the void-packages repository
zathura: backport (improved) upstream patch for buffer overflow
https://github.com/void-linux/void-packages/pull/31989
Description:
Tested on x86_64-musl, fixes #31722
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: zathura: backport (improved) upstream patch for buffer overflow
2021-07-15 21:45 [PR PATCH] zathura: backport (improved) upstream patch for buffer overflow dkwo
` (4 preceding siblings ...)
2021-07-16 20:25 ` [PR PATCH] [Merged]: " ericonr
@ 2021-07-16 20:25 ` ericonr
5 siblings, 0 replies; 7+ messages in thread
From: ericonr @ 2021-07-16 20:25 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 148 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/31989#issuecomment-881698803
Comment:
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-07-16 20:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 21:45 [PR PATCH] zathura: backport (improved) upstream patch for buffer overflow dkwo
2021-07-15 21:56 ` ericonr
2021-07-15 21:56 ` ericonr
2021-07-16 8:17 ` [PR PATCH] [Updated] " dkwo
2021-07-16 8:19 ` dkwo
2021-07-16 20:25 ` [PR PATCH] [Merged]: " ericonr
2021-07-16 20:25 ` ericonr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).