[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[screen-devel] [bug #42257] process.c contains strncpy with possibly bog
From: |
anonymous |
Subject: |
[screen-devel] [bug #42257] process.c contains strncpy with possibly bogus size argument |
Date: |
Thu, 01 May 2014 20:06:29 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:29.0) Gecko/20100101 Firefox/29.0 |
URL:
<http://savannah.gnu.org/bugs/?42257>
Summary: process.c contains strncpy with possibly bogus size
argument
Project: GNU Screen
Submitted by: None
Submitted on: Thu 01 May 2014 08:06:28 PM UTC
Category: Code Architecture
Severity: 3 - Normal
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Release: 4.2.1
Fixed Release: None
Planned Release: None
Work Required: None
_______________________________________________________
Details:
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.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 01 May 2014 08:06:28 PM UTC Name: screen-process.c.diff Size: 435B
By: None
<http://savannah.gnu.org/bugs/download.php?file_id=31291>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?42257>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [screen-devel] [bug #42257] process.c contains strncpy with possibly bogus size argument,
anonymous <=