diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c index b1e65ac5b674..895b871b0198 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c @@ -28,9 +28,9 @@ * Use is subject to license terms. */ -#if defined(sun) -#pragma ident "%Z%%M% %I% %E% SMI" -#endif +/* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ #include #include @@ -63,6 +63,7 @@ #if !defined(sun) #include #include +#include #include #include #include @@ -2256,8 +2257,7 @@ fasttrap_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int fflag, fasttrap_probe_spec_t *probe; uint64_t noffs; size_t size; - int ret; - char *c; + int ret, err; if (copyin(&uprobe->ftps_noffs, &noffs, sizeof (uprobe->ftps_noffs))) @@ -2286,18 +2286,16 @@ fasttrap_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int fflag, * Verify that the function and module strings contain no * funny characters. */ - for (c = &probe->ftps_func[0]; *c != '\0'; c++) { - if (*c < 0x20 || 0x7f <= *c) { - ret = EINVAL; - goto err; - } + if (u8_validate(probe->ftps_func, strlen(probe->ftps_func), + NULL, U8_VALIDATE_ENTIRE, &err) < 0) { + ret = EINVAL; + goto err; } - for (c = &probe->ftps_mod[0]; *c != '\0'; c++) { - if (*c < 0x20 || 0x7f <= *c) { - ret = EINVAL; - goto err; - } + if (u8_validate(probe->ftps_mod, strlen(probe->ftps_mod), + NULL, U8_VALIDATE_ENTIRE, &err) < 0) { + ret = EINVAL; + goto err; } #ifdef notyet diff --git a/sys/modules/dtrace/fasttrap/Makefile b/sys/modules/dtrace/fasttrap/Makefile index 45ff7bf51eef..6882dc9d03c3 100644 --- a/sys/modules/dtrace/fasttrap/Makefile +++ b/sys/modules/dtrace/fasttrap/Makefile @@ -20,9 +20,13 @@ CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc .PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc/dtrace .endif +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/common/unicode +SRCS+= u8_textprep.c + CFLAGS+= -DSMP .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= -Wno-cast-qual CWARNFLAGS+= -Wno-unused