🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nn
2 messages
2 total messages Started by Erik E. Rantapaa Wed, 04 Mar 1992 01:37
Selecting article after last in menu page causes seg fault
#2540
Author: 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
Re: Selecting article after last in menu page causes seg fault
#2544
Author: Jeff Howard
Date: Wed, 04 Mar 1992 10:05
20 lines
1766 bytes
In article <rantapaa.699673054@s6.math.umn.edu>, rantapaa@s6.math.umn.edu (Erik E. Rantapaa) writes:
|> 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.
|> 
.. code and correction deleted ...
 
We found the same problem and corrected it as per your article (I was just
about to write a message when I saw yours). Perhaps the error was introduced
in the last patch as it would seem fairly obvious.

------------------------------------------------------------------------------
Jeff Howard, Programmer.                      Deptartment of Computer Science,
ARNet: j-howard@adfa.oz.au                   Australian Defence Force Academy, 
Ph: [Int.:(+61 6) Nat.:(06)] 268 8049                Northcott Dve., Campbell,
Fax: [(+61 6)|(06)] 268 8581                   Canberra, ACT, Australia, 2602.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads