🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nn
Article #2540

Selecting article after last in menu page causes seg fault

#2540
From: Erik E. Rantapaa
Date: Wed, 04 Mar 1992 01:37
30 lines
1491 bytes
Has any else encountered this problem with nn:

  Suppose the initial menu has entries 'a' through 'h'.
  Selecting 'i' causes a segmentation fault.  Selecting
  'j' or higher beeps as expected.

I'm running nn 6.4.16 on a Sun 4, Sun-OS 4.1.1 and using /bin/cc.

The problem looks like a typical off by one error in menu.c:

menu.c, line 724:
..
    if (map & K_ARTICLE_ID) {
	article_id = map & ~K_ARTICLE_ID;
	map = K_ARTICLE_ID;

	if (article_id < 0 || article_id > menu_articles) {
	    ding();
	    goto loop;
	}
	article_id = art_id_to_mi[article_id]->mi_cura;
..

The comparison should be 

	if (article_id < 0 || article_id >= menu_articles) {
		...     
--
--
Erik Rantapaa                              rantapaa@math.umn.edu
Technical Details
Message-ID: <rantapaa.699673054@s6.math.umn.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!sparky!uunet!think.com!mips!news.cs.indiana.edu!umn.edu!s6.math.umn.edu!rantapaa

Show Full Headers
Complete Article Headers
Message-ID: <rantapaa.699673054@s6.math.umn.edu>
Subject: Selecting article after last in menu page causes seg fault
Date: Wed, 4 Mar 1992 01:37:34 GMT
From: rantapaa@s6.math.umn.edu (Erik E. Rantapaa)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!sparky!uunet!think.com!mips!news.cs.indiana.edu!umn.edu!s6.math.umn.edu!rantapaa
Newsgroups: news.software.nn
Keywords: nn,menu.c,segmentation fault
Sender: news@news2.cis.umn.edu (Usenet News Administration)
Nntp-Posting-Host: s6.math.umn.edu
Organization: University of Minnesota
Lines: 30