Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/external/bsd/file/dist/src Apply patch, requested by rias...



details:   https://anonhg.NetBSD.org/src/rev/52ae4f631427
branches:  netbsd-8
changeset: 374123:52ae4f631427
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Apr 01 16:41:00 2023 +0000

description:
Apply patch, requested by riastradh in ticket #1818:

        external/bsd/file/dist/src/readelf.c (apply patch)

PR kern/52532: fix bounds check in ELF header parser.

diffstat:

 external/bsd/file/dist/src/readelf.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r c6891af96e90 -r 52ae4f631427 external/bsd/file/dist/src/readelf.c
--- a/external/bsd/file/dist/src/readelf.c      Sat Apr 01 16:34:04 2023 +0000
+++ b/external/bsd/file/dist/src/readelf.c      Sat Apr 01 16:41:00 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readelf.c,v 1.15 2017/05/25 00:11:26 christos Exp $    */
+/*     $NetBSD: readelf.c,v 1.15.2.1 2023/04/01 16:41:00 martin Exp $  */
 
 /*
  * Copyright (c) Christos Zoulas 2003.
@@ -32,7 +32,7 @@
 #if 0
 FILE_RCSID("@(#)$File: readelf.c,v 1.136 2017/03/29 19:09:52 christos Exp $")
 #else
-__RCSID("$NetBSD: readelf.c,v 1.15 2017/05/25 00:11:26 christos Exp $");
+__RCSID("$NetBSD: readelf.c,v 1.15.2.1 2023/04/01 16:41:00 martin Exp $");
 #endif
 #endif
 
@@ -517,7 +517,7 @@ do_bid_note(struct magic_set *ms, unsign
     size_t noff, size_t doff, int *flags)
 {
        if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 &&
-           type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) {
+           type == NT_GNU_BUILD_ID && (descsz >= 4 && descsz <= 20)) {
                uint8_t desc[20];
                const char *btype;
                uint32_t i;



Home | Main Index | Thread Index | Old Index