Subject: bin/5123: patch dumps core on malformed input
To: None <>
From: Ignatios Souvatzis <>
List: netbsd-bugs
Date: 03/06/1998 23:35:10
>Number:         5123
>Category:       bin
>Synopsis:       patch dumps core on malformed input
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar  6 14:50:01 1998
>Originator:     Ignatios Souvatzis
>Release:        -current patch as of Fri Mar  6 23:27:20 MET 1998
System: NetBSD 1.3C NetBSD 1.3C (JOCELYN) #24: Wed Mar 4 22:22:53 MET 1998 amiga

|Content-Type: text/plain; charset=iso-8859-1; name="french-amiga-xkb.patch"
|Content-Transfer-Encoding: quoted-printable
|Content-Description: `diff -c'
|*** ./xc/programs/xkbcomp/geometry/amiga.orig  Fri Aug 22 11:47:42 1997
|--- ./xc/programs/xkbcomp/geometry/amiga       Sun Mar  1 23:34:54 1998
Patching file ./xc/programs/xkbcomp/geometry/amiga using Plan A...
assertion "fillsrc==p_end+1 || fillsrc==repl_beginning" failed: file "pch.c", line 741
Abort trap (core dumped)

	I tried to apply a diff sent in by a user, forgetting to correctly
	unpack it (it was encoded quoted-printable).
	I can provide the diff on demand.
	I guess, swapping some asserts with conditional error exits in pch.c
	would help. Is this the right thing to do?