changeset 11275:616d1b95d598

6906409 ima.c code's lltostr() system call usage is incorrectly
author yi zhang - Sun Microsystems - Beijing China <Zhang.Yi@Sun.COM>
date Tue, 08 Dec 2009 08:34:19 +0800
parents af22d36eeb81
children 4569547d4c39
files usr/src/lib/libsun_ima/common/ima.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/libsun_ima/common/ima.c	Mon Dec 07 16:07:12 2009 -0800
+++ b/usr/src/lib/libsun_ima/common/ima.c	Tue Dec 08 08:34:19 2009 +0800
@@ -3309,9 +3309,9 @@
 			return (IMA_STATUS_SUCCESS);
 		}
 		value = (long long)pg.t_value.v_integer;
-		ptr = lltostr(value, tmp);
+		ptr = lltostr(value, &tmp[MAX_LONG_LONG_STRING_LEN -1]);
 		if ((ptr != NULL) && (ptr != tmp)) {
-			*(tmp + 1) = '\0';
+			tmp[MAX_LONG_LONG_STRING_LEN - 1] = '\0';
 		} else {
 			(void) close(fd);
 			return (IMA_ERROR_UNEXPECTED_OS_ERROR);
@@ -3319,15 +3319,15 @@
 		switch (param->tunable_objectType) {
 			case ISCSI_RX_TIMEOUT_VALUE:
 				(void) strlcpy(param->tunable_objectValue,
-				    ptr, strlen(ptr));
+				    ptr, strlen(ptr) + 1);
 				break;
 			case ISCSI_CONN_DEFAULT_LOGIN_MAX:
 				(void) strlcpy(param->tunable_objectValue,
-				    ptr, strlen(ptr));
+				    ptr, strlen(ptr) + 1);
 				break;
 			case ISCSI_LOGIN_POLLING_DELAY:
 				(void) strlcpy(param->tunable_objectValue,
-				    ptr, strlen(ptr));
+				    ptr, strlen(ptr) + 1);
 				break;
 			default:
 				break;