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/