1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-14 23:33:23 +00:00

Red Hat issue 1022048: strncpy hardening

This commit is contained in:
Gerhard Rieger 2014-01-19 14:35:23 +01:00
parent 82231ad799
commit 520e84aba7
14 changed files with 117 additions and 86 deletions

View file

@ -1,5 +1,5 @@
/* source: xioparam.c */
/* Copyright Gerhard Rieger 2001-2006 */
/* Copyright Gerhard Rieger */
/* Published under the GNU General Public License V.2, see file COPYING */
/* this file contains the source for xio options handling */
@ -54,7 +54,8 @@ int xiosetopt(char what, const char *arg) {
int xioinqopt(char what, char *arg, size_t n) {
switch (what) {
case 's': return xioopts.strictopts;
case 'p': strncpy(arg, xioopts.pipesep, n);
case 'p':
arg[0] = '\0'; strncat(arg, xioopts.pipesep, n-1);
return 0;
case 'o': return xioopts.ip4portsep;
case 'l': return xioopts.logopt;