diff options
author | wchang0222%aol.com <devnull@localhost> | 2004-04-22 21:29:35 +0000 |
---|---|---|
committer | wchang0222%aol.com <devnull@localhost> | 2004-04-22 21:29:35 +0000 |
commit | 74dac710c0aa61b52e90c27e63ab08f731c6f50f (patch) | |
tree | 6edaf64d63f8876142c7b3cd08cd7d83b7fb99dd | |
parent | f70daeec9ae46bae2cd770fc162217e66ce7c1d5 (diff) | |
download | nspr-hg-74dac710c0aa61b52e90c27e63ab08f731c6f50f.tar.gz |
Bugzilla bug 162786: fixed a bug where PR_snprintf returns wrong string
length (one too small), in the case where the buffer overflows. The patch
is contributed by Jonathan Tash (tash@kontiki.com). r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r-- | pr/src/io/prprf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pr/src/io/prprf.c b/pr/src/io/prprf.c index 00440cf9..981c3fb1 100644 --- a/pr/src/io/prprf.c +++ b/pr/src/io/prprf.c @@ -1180,7 +1180,7 @@ PR_IMPLEMENT(PRUint32) PR_vsnprintf(char *out, PRUint32 outlen,const char *fmt, /* If we added chars, and we didn't append a null, do it now. */ if( (ss.cur != ss.base) && (*(ss.cur - 1) != '\0') ) - *(--ss.cur) = '\0'; + *(ss.cur - 1) = '\0'; n = ss.cur - ss.base; return n ? n - 1 : n; |