summaryrefslogtreecommitdiff
path: root/sys/isofs/udf
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2005-03-30 00:30:52 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2005-03-30 00:30:52 +0000
commitab90071412973f920164985b0b6bcdd98d2f1fda (patch)
tree4f43ee1fd52ff854d7557035b06dc24a70909d27 /sys/isofs/udf
parent017b3d09667b7b90399e06032d078dfe791d058d (diff)
Before doing the 8->16 bit expansion using a fixed-size buffer,
bound-check the string to see if it can be correctly translated.
Diffstat (limited to 'sys/isofs/udf')
-rw-r--r--sys/isofs/udf/udf_vnops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/isofs/udf/udf_vnops.c b/sys/isofs/udf/udf_vnops.c
index 92c1043ac71..03e05e9dec9 100644
--- a/sys/isofs/udf/udf_vnops.c
+++ b/sys/isofs/udf/udf_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_vnops.c,v 1.1 2005/03/29 17:24:52 pedro Exp $ */
+/* $OpenBSD: udf_vnops.c,v 1.2 2005/03/30 00:30:51 pedro Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
@@ -480,6 +480,11 @@ udf_transname(char *cs0string, char *destname, int len, struct udf_mnt *udfmp)
unicode_t *transname;
int i, unilen = 0, destlen;
+ if (len > MAXNAMLEN) {
+ printf("udf_transname(): name too long\n");
+ return (0);
+ }
+
/* allocate a buffer big enough to hold an 8->16 bit expansion */
transname = pool_get(&udf_trans_pool, PR_WAITOK);