author | Ethan Hugg <ethanhugg@gmail.com> |
Wed, 17 Oct 2012 18:57:57 -0700 | |
changeset 110609 | cb573b9307e5f2c48a29973fd9ff69e6dcf8ef6c |
parent 110608 | d9520848b41007798e64514877cb89391f9067a0 |
child 110610 | 28d5bb4008ec7d9c007ed4e8315fcc9758e2b0b9 |
child 110986 | 9b5bd852aec9a5ae32f0de09ca822690ef851d81 |
push id | 23702 |
push user | rjesup@wgate.com |
push date | Thu, 18 Oct 2012 04:35:40 +0000 |
treeherder | mozilla-central@cb573b9307e5 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jesup |
bugs | 798873 |
milestone | 19.0a1 |
first release with | nightly linux32
cb573b9307e5
/
19.0a1
/
20121018030618
/
files
nightly linux64
cb573b9307e5
/
19.0a1
/
20121018030618
/
files
nightly mac
cb573b9307e5
/
19.0a1
/
20121018030618
/
files
nightly win32
cb573b9307e5
/
19.0a1
/
20121018030618
/
files
nightly win64
cb573b9307e5
/
19.0a1
/
20121018030618
/
files
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
releases | nightly linux32
19.0a1
/
20121018030618
/
pushlog to previous
nightly linux64
19.0a1
/
20121018030618
/
pushlog to previous
nightly mac
19.0a1
/
20121018030618
/
pushlog to previous
nightly win32
19.0a1
/
20121018030618
/
pushlog to previous
nightly win64
19.0a1
/
20121018030618
/
pushlog to previous
|
media/webrtc/signaling/src/sipcc/cpr/common/cpr_string.c | file | annotate | diff | comparison | revisions |
--- a/media/webrtc/signaling/src/sipcc/cpr/common/cpr_string.c +++ b/media/webrtc/signaling/src/sipcc/cpr/common/cpr_string.c @@ -173,16 +173,24 @@ void flex_string_append(flex_string *fs, void flex_string_sprintf(flex_string *fs, const char *format, ...) { va_list ap; int vsnprintf_result; va_start(ap, format); vsnprintf_result = vsnprintf(fs->buffer + fs->string_length, fs->buffer_length - fs->string_length, format, ap); va_end(ap); + /* Special case just for Windows where vsnprintf is broken + and returns -1 if buffer too large unless you size it 0. */ + if (vsnprintf_result < 0) { + va_start(ap, format); + vsnprintf_result = vsnprintf(NULL, 0, format, ap); + va_end(ap); + } + if (fs->string_length + vsnprintf_result >= fs->buffer_length) { /* Buffer overflow, resize */ flex_string_check_alloc(fs, fs->string_length + vsnprintf_result + 1); /* Try again with new buffer */ va_start(ap, format); vsnprintf_result = vsnprintf(fs->buffer + fs->string_length, fs->buffer_length - fs->string_length, format, ap); MOZ_ASSERT(vsnprintf_result > 0 && vsnprintf_result < (fs->buffer_length - fs->string_length));