bugGNU Octave - Bugs: bug #63436, Null pointer warning for error.cc

 
 

bug #63436: Null pointer warning for error.cc

Submitter:  Arun Giridhar <arungiridhar>
Submitted:  Mon 28 Nov 2022 08:23:39 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * stable Operating System:  * Any
Fixed Release:  8.1.0 Planned Release:  8.1.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 28 Nov 2022 09:05:17 PM UTC, comment #2: 

Your change looks good to me. Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Mon 28 Nov 2022 08:30:40 PM UTC, comment #1: 

Pushed it here for now: https://hg.savannah.gnu.org/hgweb/octave/rev/785ac0d19116

Marking as Ready For Test.

Arun Giridhar <arungiridhar>
Group Member
Mon 28 Nov 2022 08:23:39 PM UTC, original submission:  

A static analyzer gave me a null pointer warning for `id` in this code in error.cc:

  void error_system::vusage (const char *id, const char *fmt, va_list args)
  {
    std::string str_id = id ? id : "";
    std::string message = format_message (fmt, args);

    throw_error ("usage", id, message);
  }


I think the last line should say `str_id`, not just `id`, otherwise we'd be reading a null pointer and also not using str_id. Could someone confirm the intent of this code?

Arun Giridhar <arungiridhar>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-11-28 mmuetzel CategoryNone Interpreter
        Item GroupNone Segfault, Bus Error, etc.
        StatusReady For Test Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 8.1.0
    2022-11-28 arungiridhar StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code