iconv.c (148342) | iconv.c (149415) |
---|---|
1/*- 2 * Copyright (c) 2000-2001, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2000-2001, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/libkern/iconv.c 148342 2005-07-23 16:52:57Z imura $"); | 34__FBSDID("$FreeBSD: head/sys/libkern/iconv.c 149415 2005-08-24 12:38:26Z imura $"); |
35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/kernel.h> 39#include <sys/iconv.h> 40#include <sys/malloc.h> 41#include <sys/mount.h> 42#include <sys/syslog.h> --- 331 unchanged lines hidden (view full) --- 374 375 error = SYSCTL_IN(req, &din, sizeof(din)); 376 if (error) 377 return error; 378 if (din.ia_version != ICONV_ADD_VER) 379 return EINVAL; 380 if (din.ia_datalen > ICONV_CSMAXDATALEN) 381 return EINVAL; | 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/kernel.h> 39#include <sys/iconv.h> 40#include <sys/malloc.h> 41#include <sys/mount.h> 42#include <sys/syslog.h> --- 331 unchanged lines hidden (view full) --- 374 375 error = SYSCTL_IN(req, &din, sizeof(din)); 376 if (error) 377 return error; 378 if (din.ia_version != ICONV_ADD_VER) 379 return EINVAL; 380 if (din.ia_datalen > ICONV_CSMAXDATALEN) 381 return EINVAL; |
382 if (strlen(din.ia_from) >= ICONV_CSNMAXLEN) 383 return EINVAL; 384 if (strlen(din.ia_to) >= ICONV_CSNMAXLEN) 385 return EINVAL; 386 if (strlen(din.ia_converter) >= ICONV_CNVNMAXLEN) 387 return EINVAL; |
|
382 if (iconv_lookupconv(din.ia_converter, &dcp) != 0) 383 return EINVAL; 384 error = iconv_register_cspair(din.ia_to, din.ia_from, dcp, NULL, &csp); 385 if (error) 386 return error; 387 if (din.ia_datalen) { 388 csp->cp_data = malloc(din.ia_datalen, M_ICONVDATA, M_WAITOK); 389 error = copyin(din.ia_data, csp->cp_data, din.ia_datalen); --- 134 unchanged lines hidden --- | 388 if (iconv_lookupconv(din.ia_converter, &dcp) != 0) 389 return EINVAL; 390 error = iconv_register_cspair(din.ia_to, din.ia_from, dcp, NULL, &csp); 391 if (error) 392 return error; 393 if (din.ia_datalen) { 394 csp->cp_data = malloc(din.ia_datalen, M_ICONVDATA, M_WAITOK); 395 error = copyin(din.ia_data, csp->cp_data, din.ia_datalen); --- 134 unchanged lines hidden --- |