Bug 26698 - PATCH: editors/lpe 1.2.5 segfault on permission denied
Summary: PATCH: editors/lpe 1.2.5 segfault on permission denied
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-04-19 10:50 UTC by Ryan Thompson
Modified: 2001-04-23 23:49 UTC (History)
0 users

See Also:


Attachments
file.diff (567 bytes, patch)
2001-04-19 10:50 UTC, Ryan Thompson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Thompson 2001-04-19 10:50:01 UTC
	lpe 1.2.5 as built from today's ports (nothing 
	interesting in the commit logs anyway) will dump 
	core without fail when a file when fopen() fails 
	on an existing file (eg, permission denied)

	The homespun die() lpe.c incorrectly tries to
	free() each node in the doubly linked list of 
	lines of text in its internal storage buffer,
	when (portions of) that buffer may not have been
	initialized as a result of a premature exit.

Fix: Solution is to prevent die() from free()ing
	nodes if the text buffer is null. 

How-To-Repeat: 	chmod 000 somefile
	lpe somefile
	(as a normal user ;-)
Comment 1 Jimmy Olgeni freebsd_committer freebsd_triage 2001-04-20 15:10:34 UTC
Looks like this should be added to files/.

Did you submit this patch to maintainer?

(new email address: calle.madestrand@norrgarden.se)

You may also wish to submit this patch to the lpe authors too, since
it's a generic bugfix not specific to FreeBSD only.

Thanks!

-- 
jimmy
Comment 2 Ryan Thompson 2001-04-20 22:01:13 UTC
Jimmy Olgeni wrote to freebsd-gnats-submit@FreeBSD.org and ryan@sasknow.com:

> Looks like this should be added to files/.

Yes.

> Did you submit this patch to maintainer?

Yes.

> (new email address: calle.madestrand@norrgarden.se)
> 
> You may also wish to submit this patch to the lpe authors too, since
> it's a generic bugfix not specific to FreeBSD only.

Yes.

> Thanks!
> 

You're welcome! ;-)

- Ryan

-- 
  Ryan Thompson <ryan@sasknow.com>
  Network Administrator, Accounts

  SaskNow Technologies - http://www.sasknow.com
  #106-380 3120 8th St E - Saskatoon, SK - S7H 0W2

        Tel: 306-664-3600   Fax: 306-664-1161   Saskatoon
  Toll-Free: 877-727-5669     (877-SASKNOW)     North America
Comment 3 Jimmy Olgeni freebsd_committer freebsd_triage 2001-04-23 23:47:49 UTC
State Changed
From-To: open->closed

Patch approved by maintainer in ports/26804, and committed. Thanks!