bugGNU Screen - Bugs: bug #42257, process.c contains strncpy with...

 
 

bug #42257: process.c contains strncpy with possibly bogus size argument

Submitter:  None
Submitted:  Thu 01 May 2014 08:06:28 PM UTC
   
 
Category:  Code Architecture Severity:  3 - Normal
Priority:  * 5 - Normal Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  4.2.1
Fixed Release:  None Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 10 May 2014 04:17:47 PM UTC, comment #1: 

Thanks, merged.

Amadeusz Sławiński <amade>
Group administrator
Thu 01 May 2014 08:06:28 PM UTC, original submission:  

Hi,

process.c contains a strncpy(3) call with a possibly bogus size argument around line 6285. clang warns about this and is correct:

<code>
process.c:6285:35: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]
    strncpy(p, buf, 1 + (l < len) ? l : len);
</code>

Attached is a patch to make this behave like it should.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #31291:  screen-process.c.diff added by None (435B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by amade (Posted a comment)
  •  

    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 logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-05-10 amade StatusNone Fixed
        Open/ClosedOpen Closed
    2014-05-01 None Attached File- Added screen-process.c.diff, #31291

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code