From a32dd5a1510abc8ffe97a9cbea2c32b28dc891bd Mon Sep 17 00:00:00 2001 From: imura Date: Wed, 24 Aug 2005 12:38:26 +0000 Subject: - Fix checking range of strings of struct iconv_add_in in libsmb and libkiconv, - Add checking range of strings to iconv_sysctl_add(). Submitted by: Rudolf Cejka --- sys/libkern/iconv.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys') diff --git a/sys/libkern/iconv.c b/sys/libkern/iconv.c index 5bc1fdf..7010bb2 100644 --- a/sys/libkern/iconv.c +++ b/sys/libkern/iconv.c @@ -379,6 +379,12 @@ iconv_sysctl_add(SYSCTL_HANDLER_ARGS) return EINVAL; if (din.ia_datalen > ICONV_CSMAXDATALEN) return EINVAL; + if (strlen(din.ia_from) >= ICONV_CSNMAXLEN) + return EINVAL; + if (strlen(din.ia_to) >= ICONV_CSNMAXLEN) + return EINVAL; + if (strlen(din.ia_converter) >= ICONV_CNVNMAXLEN) + return EINVAL; if (iconv_lookupconv(din.ia_converter, &dcp) != 0) return EINVAL; error = iconv_register_cspair(din.ia_to, din.ia_from, dcp, NULL, &csp); -- cgit v1.1