From: Enrico Scholz Date: Tue, 1 Feb 2005 00:55:51 +0000 (+0000) Subject: argl... fixed overflow when appending the '/' X-Git-Tag: IPSENTINEL_VERSION_0_12~157 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68a4cdcaa9dbc6a451b8c29736133b25f9ef34b2;p=util-vserver.git argl... fixed overflow when appending the '/' git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1837 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/lib/createskeleton-full.hc b/util-vserver/lib/createskeleton-full.hc index 8090a93..d1a0793 100644 --- a/util-vserver/lib/createskeleton-full.hc +++ b/util-vserver/lib/createskeleton-full.hc @@ -24,12 +24,12 @@ #define CONCAT_TWO_ARGS(BUF, LHS,RHS) \ size_t BUF ## l1 = strlen(LHS); \ size_t BUF ## l2 = strlen(RHS); \ - char BUF[BUF ## l1 + BUF ## l2 + 2]; \ + char BUF[BUF##l1 + BUF##l2 + 2]; \ \ - memcpy(BUF, LHS, BUF ## l1 + 1); \ - if (BUF ## l2>0) { \ - memcpy(BUF+BUF ## l1, "/", BUF ## l1); \ - memcpy(BUF+BUF ## l1+1, RHS, BUF ## l2+1); \ + memcpy(BUF, LHS, BUF##l1 + 1); \ + if (BUF##l2 > 0) { \ + BUF[ BUF##l1 ] = '/'; \ + memcpy(BUF+ BUF##l1 + 1, RHS, BUF##l2 + 1); \ } static inline int