octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63436] Null pointer warning for error.cc


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #63436] Null pointer warning for error.cc
Date: Mon, 28 Nov 2022 15:23:41 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?63436>

                 Summary: Null pointer warning for error.cc
                 Project: GNU Octave
               Submitter: arungiridhar
               Submitted: Mon 28 Nov 2022 03:23:39 PM EST
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: stable
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: 8.1.0 (current stable)


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 28 Nov 2022 03:23:39 PM EST By: Arun Giridhar <arungiridhar>
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?







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63436>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]