Loading...
libkdd/KCDBasicTypeDescription.m xnu-12377.121.6 xnu-4570.41.2
--- xnu/xnu-12377.121.6/libkdd/KCDBasicTypeDescription.m
+++ xnu/xnu-4570.41.2/libkdd/KCDBasicTypeDescription.m
@@ -136,7 +136,10 @@
 		retval[_name] = [self objectForType:_subtype_desc.kcs_elem_type withData:&data[_subtype_desc.kcs_elem_offset]];
 	} else if (_subtype_desc.kcs_elem_type == KC_ST_CHAR) {
 		char *s = (char *)&data[_subtype_desc.kcs_elem_offset];
-		retval[_name] = [NSString stringWithFormat:@"%.*s", (int)elem_count, s];
+		if (!(strnlen(s, length) < length)) {
+			return nil;
+		}
+		retval[_name] = [NSString stringWithFormat:@"%s", s];
 	} else {
 		NSMutableArray * objArray = [NSMutableArray arrayWithCapacity:elem_count];
 		for (unsigned int i = 0; i < elem_count; i++) {