NetBSD-Bugs archive

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

PR/56260 CVS commit: [netbsd-8] src



The following reply was made to PR lib/56260; it has been noted by GNATS.

From: "Martin Husemann" <martin%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/56260 CVS commit: [netbsd-8] src
Date: Sat, 9 Dec 2023 13:10:16 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Dec  9 13:10:16 UTC 2023
 
 Modified Files:
 	src/lib/libc/gen [netbsd-8]: vis.c
 	src/tests/lib/libc/gen [netbsd-8]: t_vis.c
 
 Log Message:
 Pull up following revision(s) (requested by riastradh in ticket #1923):
 
 	lib/libc/gen/vis.c: revision 1.75-1.86
 	tests/lib/libc/gen/t_vis.c: revision 1.10-1.14
 
 PR 56260: fix out-of-bounds stack read.
 
 vis(3): Avoid nonportable MIN in portable code.
 
 vis(3) tests: Add xfail test for encoding overflow.
 
 From Kyle Evans <kevans%FreeBSD.org@localhost>.
 PR lib/57573
 
 vis(3) tests: Expand tests and diagnostic outputs on failure.
 PR lib/57573
 
 vis(3) tests: Test another overflow edge case.
 Related to PR lib/57573.
 
 vis(3): Make maxolen unsigned size_t, not ssize_t.
 It is initialized once either to *dlen, which is unsigned size_t, or
 to wcslen(start) * MB_MAX_LEN + 1, and wcslen returns unsigned size_t
 too.  So there appears to have never been any reason for this to be
 signed.
 Part of PR lib/57573.
 
 vis(3): Make mbslength unsigned.
 Sprinkle assertions and comments justifying the proposition that it
 would never go negative if signed.
 Obviates need to worry about mblength > SSIZE_MAX.
 Prompted by PR lib/57573.
 
 vis(3): Avoid arithmetic overflow before calloc(3).
 Prompted by PR lib/57573.
 
 vis(3): Call wcslen(start) only once.
 It had better not change between these two times!
 Prompted by PR lib/57573.
 
 vis(3): Avoid potential arithmetic overflow in maxolen.
 Can't easily prove that this overflow is impossible, so let's add a
 check.
 Prompted by PR lib/57573.
 
 vis(3): Fix main part of PR lib/57573.
 From Kyle Evans <kevans%FreeBSD.org@localhost>.
 
 vis(3): Fix one more buffer overrun in an edge case.
 PR lib/57573
 
 vis(3): Sort includes.  No functional change intended.
 Prompted by PR lib/57573.
 
 vis(3): Need <stdint.h> for SIZE_MAX, per C standard.
 From Kyle Evans <kevans%FreeBSD.org@localhost>.
 Followup to PR lib/57573.
 
 vis(3): Per KNF, sys/param.h comes before sys/types.h.
 Which is nice because that's also lexicographic.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.73.4.1 -r1.73.4.2 src/lib/libc/gen/vis.c
 cvs rdiff -u -r1.9 -r1.9.6.1 src/tests/lib/libc/gen/t_vis.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index