-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for Feh's right-click buffer overflow crash #259649
Conversation
Thanks for the fix. |
Thank you for your reply! Sorry, I can't understand where I should link my PR. Can you give me a clue? |
Looks good now, thank you. Please squash your commits (see here if you don't know how). Result of nixpkgs-review on x86_64-linux: ✔️
|
I have tried to squash the commits. Is it good? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easily reproducible crash and the patch does indeed fix it. Thanks for the contribution!
You are welcome! |
We prefer to Please apply diff --git a/pkgs/applications/graphics/feh/0001-Right-click-crash-fix.patch b/pkgs/applications/graphics/feh/0001-Right-click-crash-fix.patch
deleted file mode 100644
index ce3266fb8691..000000000000
--- a/pkgs/applications/graphics/feh/0001-Right-click-crash-fix.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 2c31f8863b80030e772a529ade519fc2fee4a991 Mon Sep 17 00:00:00 2001
-From: Ametov Imil <charlz_klug@mail.ru>
-Date: Fri, 6 Oct 2023 00:03:58 +0300
-Subject: [PATCH] Fix for right-click buffer overflow
-
----
- src/menu.c | 16 ++++++----------
- 1 file changed, 6 insertions(+), 10 deletions(-)
-
-diff --git a/src/menu.c b/src/menu.c
-index 455ed19b..b1ef61d0 100644
---- a/src/menu.c
-+++ b/src/menu.c
-@@ -825,21 +825,17 @@ void feh_menu_draw_toggle_at(int x, int y, int w, int h, Imlib_Image dst, int ox
-
- void feh_menu_draw_submenu_at(int x, int y, Imlib_Image dst, int ox, int oy)
- {
-- ImlibPolygon poly;
--
-- x -= ox;
-+ // Draw filled triangle
-+ x -= ox;
- y -= oy;
-
- imlib_context_set_image(dst);
--
-- poly = imlib_polygon_new();
-- imlib_polygon_add_point(poly, x, y + 3);
-- imlib_polygon_add_point(poly, x + 3, y + 6);
-- imlib_polygon_add_point(poly, x, y + 9);
- imlib_context_set_color(0, 0, 0, 255);
-- imlib_image_fill_polygon(poly);
-- imlib_polygon_free(poly);
-
-+ for (int i= 0; i <= 3; i++) {
-+ imlib_image_draw_line(x+i, y+3+i, x+i, y+9-i, 0);
-+ }
-+
- return;
- }
-
\ No newline at end of file
diff --git a/pkgs/applications/graphics/feh/default.nix b/pkgs/applications/graphics/feh/default.nix
index 4f4a0cfce85c..e2304a27d0fa 100644
--- a/pkgs/applications/graphics/feh/default.nix
+++ b/pkgs/applications/graphics/feh/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, makeWrapper
+{ lib, stdenv, fetchFromGitHub, makeWrapper, fetchpatch
, xorg, imlib2, libjpeg, libpng
, curl, libexif, jpegexiforient, perl
, enableAutoreload ? !stdenv.hostPlatform.isDarwin }:
@@ -16,7 +16,11 @@ stdenv.mkDerivation rec {
patches = [
# upstream PR: https://github.com/derf/feh/pull/723
- ./0001-Right-click-crash-fix.patch
+ (fetchpatch {
+ name = "fix-right-click-buffer-overflow.patch";
+ url = "https://github.com/derf/feh/commit/2c31f8863b80030e772a529ade519fc2fee4a991.patch";
+ sha256 = "sha256-sUWS06qt1d1AyGfqKb+1BzZslYxOzur4q0ePEHcTz1g=";
+ })
];
outputs = [ "out" "man" "doc" ] |
Description of changes
Added a patch for fix the right-click crash. #258444
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)