bugGNU Octave - Bugs: bug #41053, out of bounds error in...


bug #41053: out of bounds error in get_first_help_sentence.m

Submitted by:  Philip Nienhuis <philipnienhuis>
Submitted on:  Wed 01 Jan 2014 11:59:59 AM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  Philip Nienhuis <philipnienhuis>
Originator Name:  Philip Nienhuis Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Thu 02 Jan 2014 05:08:50 PM UTC, comment #2: 

I applied your patch to the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/f80d258a2c7d).

Rik <rik5>
Project Administrator
Thu 02 Jan 2014 10:58:08 AM UTC, comment #1: 

patch attached

(file #30147)

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Wed 01 Jan 2014 11:59:59 AM UTC, original submission:  

From the discussion in patch #8099 it emerged that get_first_help_sentence function could be made more robust.

The stanza in L.127-131:

    end_idx = strfind (help_text, sprintf ("@end %s", def_type))(1);
    if (isempty (end_idx))
      error ("get_first_help_sentence: couldn't parse texinfo");
    keep(end_idx:end) = false;

contains the almost classical pitfall of already taking the first element of some output array before testing whether it is empty. The fix is of course easy, it had better read as follows:

    end_idx = strfind (help_text, sprintf ("@end %s", def_type));
    if (isempty (end_idx))
      error ("get_first_help_sentence: couldn't parse texinfo");
    keep(end_idx(1):end) = false;

I'll prepare a cset.

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by philipnienhuis (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-02 rik5 StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2014-01-02 philipnienhuis Attached File- => Added get_first_help_sentence.cs, #30147
        StatusNone => Patch Submitted

    Back to the top

    Powered by Savane 3.5