summaryrefslogtreecommitdiffstats
path: root/bin/pax/tables.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-06-02 06:30:06 +0000
committercharnier <charnier@FreeBSD.org>1997-06-02 06:30:06 +0000
commit961f5b3e1abdffe530b197a07b82f42848ee24fe (patch)
tree3c293f2a0916099881d28160c0bbb516ea7b27d1 /bin/pax/tables.c
parent9b043dcc94d3954e2fbbcc3b36e35bd6545b6a8d (diff)
downloadFreeBSD-src-961f5b3e1abdffe530b197a07b82f42848ee24fe.zip
FreeBSD-src-961f5b3e1abdffe530b197a07b82f42848ee24fe.tar.gz
Off by 1 adjustment. Properly NUL terminate after strncpy.
Obtained from: {Net|Open}BSD
Diffstat (limited to 'bin/pax/tables.c')
-rw-r--r--bin/pax/tables.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/pax/tables.c b/bin/pax/tables.c
index a464ad1..b35bb99 100644
--- a/bin/pax/tables.c
+++ b/bin/pax/tables.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: tables.c,v 1.7 1997/02/22 14:04:43 peter Exp $
*/
#ifndef lint
@@ -180,6 +180,7 @@ chk_lnk(arcn)
*/
arcn->ln_nlen = l_strncpy(arcn->ln_name, pt->name,
PAXPATHLEN+1);
+ arcn->ln_name[PAXPATHLEN] = '\0';
if (arcn->type == PAX_REG)
arcn->type = PAX_HRG;
else
@@ -655,6 +656,7 @@ sub_name(oname, onamelen)
* and return (we know that oname has enough space)
*/
*onamelen = l_strncpy(oname, pt->nname, PAXPATHLEN+1);
+ oname[PAXPATHLEN] = '\0';
return;
}
pt = pt->fow;
OpenPOWER on IntegriCloud