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

 
 

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

Submitted by:  None
Submitted on:  Thu 01 May 2014 08:06:28 PM UTC  
 
Category: Code ArchitectureSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedRelease: 4.2.1
Fixed Release: NonePlanned Release: None
Work Required: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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

Thanks, merged.

Amadeusz Sławiński <amade>
Project 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 File(s):
   
   
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
  • -unavailable- added by amade (Posted a comment)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 10 May 2014 04:17:47 PM UTCamadeStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 01 May 2014 08:06:28 PM UTCNoneAttached File-=>Added screen-process.c.diff, #31291

    Back to the top


    Powered by Savane 3.1-cleanup1