Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From b3384a1fbfa1fee99986e5750ab8e700de4f24ad Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Thu, 5 Dec 2024 18:35:40 +0000
Subject: [PATCH] PR/579: net147: Fix stack overrun.

---
src/readelf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/readelf.c b/src/readelf.c
index fe4cf54138..d209d86dfb 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -27,7 +27,7 @@
#include "file.h"

#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.196 2024/11/11 15:49:11 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.197 2024/12/05 18:35:40 christos Exp $")
#endif

#ifdef BUILTIN_ELF
@@ -1726,7 +1726,7 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
Elf64_Phdr ph64;
const char *linking_style;
unsigned char nbuf[NBUFSIZE];
- char interp[128];
+ char interp[NBUFSIZE];
ssize_t bufsize;
size_t offset, align, need = 0;
int pie = 0, dynamic = 0;
6 changes: 6 additions & 0 deletions pkgs/tools/misc/file/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-ycx3x8VgxUMTXtxVWvYJ1WGdvvARmX6YjOQKPXXYYIg=";
};

patches = [
# https://github.com/file/file/commit/FILE5_46-7-gb3384a1f
# https://bugs.astron.com/view.php?id=638
./FILE5_46-7-gb3384a1f-PR-579-net147-Fix-stack-overrun.patch
];

outputs = [
"out"
"dev"
Expand Down