summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-08-23 08:29:44 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-08-23 08:29:44 +0000
commitaf341158dbaba37e96ddf7463a04c8ed9d732e24 (patch)
treebf65233936a4e8ad71f4dde305e07223c216497c
parente6261734a025cd9053004ded80e06d2d9401d2e3 (diff)
downloadrockbox-af341158dbaba37e96ddf7463a04c8ed9d732e24.zip
rockbox-af341158dbaba37e96ddf7463a04c8ed9d732e24.tar.gz
rockbox-af341158dbaba37e96ddf7463a04c8ed9d732e24.tar.bz2
rockbox-af341158dbaba37e96ddf7463a04c8ed9d732e24.tar.xz
bad bad bad snprintf() overflow the buffer if the string passed in with a
%s didn't fit within the buffer! git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1943 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/common/sprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/common/sprintf.c b/firmware/common/sprintf.c
index 80bdda6..c18a390 100644
--- a/firmware/common/sprintf.c
+++ b/firmware/common/sprintf.c
@@ -100,10 +100,10 @@ int vsnprintf (char *buf, int size, const char *fmt, va_list ap)
if (width > 0)
{
width -= strlen (str);
- while (width-- > 0 && buf < end)
+ while (width-- > 0 && bp < end)
*bp++ = pad;
}
- while (*str != '\0' && buf < end)
+ while (*str != '\0' && bp < end)
*bp++ = *str++;
}
else