Module Name:    src
Committed By:   apb
Date:           Thu Mar 27 19:34:39 UTC 2014

Modified Files:
        src/external/cddl/osnet/dist/lib/libdtrace/common: dt_printf.c

Log Message:
format is a pointer, so sizeof(format) is not a good length
to pass to snprintf.  Try to calculate the correct length,
taking into account the amount of space already used.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
    src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c
diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c:1.4 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c:1.5
--- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c:1.4	Wed Feb 20 22:45:12 2013
+++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c	Thu Mar 27 19:34:39 2014
@@ -1861,10 +1861,10 @@ dtrace_printf_format(dtrace_hdl_t *dtp, 
 			*f++ = '@';
 
 		if (width != 0)
-			f += snprintf(f, sizeof (format), "%d", width);
+			f += snprintf(f, format + formatlen - f, "%d", width);
 
 		if (prec != 0)
-			f += snprintf(f, sizeof (format), ".%d", prec);
+			f += snprintf(f, format + formatlen - f, ".%d", prec);
 
 		/*
 		 * If the output format is %s, then either %s is the underlying

Reply via email to