From 5322d6e604d745fb59c3bb5688a7df50b5277e1e Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Tue, 13 Apr 2010 04:17:15 +0000 Subject: =?UTF-8?q?2010-04-13=09Ralf=20Cors=C3=A9pius=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * shttpd/io_dir.c: Cast consts to size_t (Avoid overflows on implicit const casts on 16bit targets). --- cpukit/ChangeLog | 5 +++++ cpukit/shttpd/io_dir.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index a9b5701697..504f8418ba 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,8 @@ +2010-04-13 Ralf Corsépius + + * shttpd/io_dir.c: Cast consts to size_t (Avoid overflows on implicit + const casts on 16bit targets). + 2010-04-12 Ralf Corsépius * score/include/rtems/system.h: Let RTEMS_offsetof return uintptr_t diff --git a/cpukit/shttpd/io_dir.c b/cpukit/shttpd/io_dir.c index 0534c623a2..ab331c7fc7 100644 --- a/cpukit/shttpd/io_dir.c +++ b/cpukit/shttpd/io_dir.c @@ -79,7 +79,7 @@ read_dir(struct stream *stream, void *buf, size_t len) if (st.st_size < 1024) (void) my_snprintf(size, sizeof(size), "%lu", (unsigned long) st.st_size); - else if (st.st_size < 1024 * 1024) + else if (st.st_size < ((size_t)1024 * (size_t)1024)) (void) my_snprintf(size, sizeof(size), "%luk", (unsigned long) (st.st_size >> 10) + 1); else -- cgit v1.2.3