From dc562290a5a164285ef63c96de55755c072f89ea Mon Sep 17 00:00:00 2001 From: Taco Hoekwater Date: Fri, 5 Jan 2007 13:18:20 +0000 Subject: xmalloc an extra byte for the NUL after nameoffile (pipes) git-svn-id: svn://tug.org/texlive/trunk@3153 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/lib/texmfmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Build/source/texk') diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 2b5e5a83046..12307761463 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -1350,7 +1350,7 @@ open_in_or_pipe P3C(FILE **, f_ptr, int, filefmt, const_string, fopen_mode) if (shellenabledp && *(nameoffile+1) == '|') { /* the user requested a pipe */ *f_ptr = NULL; - fname = (string)xmalloc(strlen((const_string)(nameoffile+1))); + fname = (string)xmalloc(strlen((const_string)(nameoffile+1))+1); strcpy(fname,(const_string)(nameoffile+1)); #if !defined(pdfTeX) && !defined(pdfeTeX) if (fullnameoffile) @@ -1389,7 +1389,7 @@ open_out_or_pipe P2C(FILE **, f_ptr, const_string, fopen_mode) if (shellenabledp && *(nameoffile+1) == '|') { /* the user requested a pipe */ - fname = (string)xmalloc(strlen((const_string)(nameoffile+1))); + fname = (string)xmalloc(strlen((const_string)(nameoffile+1))+1); strcpy(fname,(const_string)(nameoffile+1)); if (strchr (fname,' ')==NULL && strchr(fname,'>')==NULL) { /* mp and mf currently do not use this code, but it -- cgit v1.2.3