diff options
author | sr161167 <none@none> | 2006-01-07 22:41:26 -0800 |
---|---|---|
committer | sr161167 <none@none> | 2006-01-07 22:41:26 -0800 |
commit | 0578ac30778226273ab5a411148294e23d339851 (patch) | |
tree | 1a40de914c7c8c62c5f27f1a48f14b075ccfccfa /usr/src/cmd/tar | |
parent | 9da74128699723a77069e255493ff06799cf6e59 (diff) | |
download | illumos-joyent-0578ac30778226273ab5a411148294e23d339851.tar.gz |
6350910 *tar* -E option corrupt pathname if path lengh > 100 and pathname contains multibyte characters.
Diffstat (limited to 'usr/src/cmd/tar')
-rw-r--r-- | usr/src/cmd/tar/tar.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr/src/cmd/tar/tar.c b/usr/src/cmd/tar/tar.c index 8fc42e7331..d546fa2b4d 100644 --- a/usr/src/cmd/tar/tar.c +++ b/usr/src/cmd/tar/tar.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -6217,14 +6217,15 @@ gen_utf8_names(const char *filename) tempbuf, iconv_cd, _X_LINKPATH, PATH_MAX); if ((xhdr_flgs & _X_PATH) == 0) { /* Concatenate prefix & name */ (void) strncpy(tempbuf, dblock.dbuf.prefix, PRESIZ); - tempbuf[NAMSIZ] = '\0'; + tempbuf[PRESIZ] = '\0'; nbytes = strlen(tempbuf); if (nbytes > 0) { tempbuf[nbytes++] = '/'; tempbuf[nbytes] = '\0'; } - (void) strncat(tempbuf + nbytes, dblock.dbuf.name, NAMSIZ); - tempbuf[nbytes + NAMSIZ] = '\0'; + (void) strncat(tempbuf + nbytes, dblock.dbuf.name, + (MAXNAM - nbytes)); + tempbuf[MAXNAM] = '\0'; } errors += local_utf8(&Xtarhdr.x_path, local_path, tempbuf, iconv_cd, _X_PATH, PATH_MAX); |