[SERVER-6061] Null pointer dereference segfault in mongo shell Created: 11/Jun/12  Updated: 11/Jul/16  Resolved: 12/Jun/12

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.1.1
Fix Version/s: 2.1.2

Type: Bug Priority: Major - P3
Reporter: Andy Schwerin Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

Reproduction, by asya:

$ ./mongo
> <ctl-s>
hit down arrow
(i-search)`': Sun Jun 10 14:54:24 mongo got signal 11 (Segmentation fault: 11), stack trace

Coverity output:

Null pointer dereferences
A null pointer dereference will occur.
Dereference of an explicit null value
 
Defect 10069 (STATIC_C)
  Checker FORWARD_NULL (subcategory deref_constant_null)
  File /src/mongo/shell/linenoise.cpp
  Function InputBuffer::incrementalHistorySearch(PromptBase &, int)
    /src/mongo/shell/linenoise.cpp, line: 1640
    Assigning: "activeHistoryLine" = "NULL".
        UChar32* activeHistoryLine = 0;



 Comments   
Comment by auto [ 12/Jun/12 ]

Author:

{u'login': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-6061 don't use zeroed activeHistoryLine

Handle case of exiting history search with arrow key when no
search has been done yet.
Branch: master
https://github.com/mongodb/mongo/commit/2a9e8882d54b58ee13fba7c38753e5430e15af6a

Generated at Thu Feb 08 03:10:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.