openbsd-ports/net/iperf/patches/patch-src_stdio_c
sthen bfc6ee6ff9 - fix an off-by-one in iperf triggering a segfault with (insanely) high
bandwidths, seen when investigating some bug where a too-high bandwidth
was reported.

- patch configure to not remove the -g flag from CFLAGS

ok lteo@
2013-03-03 12:29:44 +00:00

23 lines
917 B
Plaintext

$OpenBSD: patch-src_stdio_c,v 1.1 2013/03/03 12:29:44 sthen Exp $
don't run past the end of kLabel_bit[] / kLabel_Byte[] for (stupidly)
high bandwidths.
--- src/stdio.c.orig Sat Mar 2 02:07:53 2013
+++ src/stdio.c Sat Mar 2 02:07:36 2013
@@ -210,12 +210,12 @@ void byte_snprintf( char* outString, int inLen,
conv = kConv_Unit;
if ( isupper((int)inFormat) ) {
- while ( tmpNum >= 1024.0 && conv <= kConv_Giga ) {
+ while ( tmpNum >= 1024.0 && conv < kConv_Giga ) {
tmpNum /= 1024.0;
conv++;
}
} else {
- while ( tmpNum >= 1000.0 && conv <= kConv_Giga ) {
+ while ( tmpNum >= 1000.0 && conv < kConv_Giga ) {
tmpNum /= 1000.0;
conv++;
}