diff options
author | imura <imura@FreeBSD.org> | 2005-08-24 12:38:26 +0000 |
---|---|---|
committer | imura <imura@FreeBSD.org> | 2005-08-24 12:38:26 +0000 |
commit | a32dd5a1510abc8ffe97a9cbea2c32b28dc891bd (patch) | |
tree | 82f3218f6e319b639049eac4448ce42471530736 /sys/libkern | |
parent | f2022037751170a4dbecfcccec43386b53442680 (diff) | |
download | FreeBSD-src-a32dd5a1510abc8ffe97a9cbea2c32b28dc891bd.zip FreeBSD-src-a32dd5a1510abc8ffe97a9cbea2c32b28dc891bd.tar.gz |
- 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
Diffstat (limited to 'sys/libkern')
-rw-r--r-- | sys/libkern/iconv.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); |