android_system_core/libcutils
David 'Digit' Turner 833ea8d502 Fix an infinite loop in time2sub.
The problem is that time_t is signed, and the original code relied on the
fact that (X + c < X) in case of overflow for c >= 0. Unfortunately, this
condition is only guaranteed by the standard for unsigned arithmetic, and
the gcc 4.4.0 optimizer did completely remove the corresponding test from
the code. This resulted in a missing boundary check, and an infinite loop.

The problem is solved by testing explicitely for TIME_T_MIN and TIME_T_MAX
in the loop that uses this.

Also fix increment_overflow and long_increment_overflow which were buggy
for exactly the same reasons.

Also remove some compiler warnings.

Note: a similar fix was performed in bionic/libc
2009-09-09 18:32:07 -07:00
..
Android.mk Merge commit 'goog/master' into merge_master 2009-05-27 14:25:54 -07:00
MODULE_LICENSE_APACHE2 auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
NOTICE auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
abort_socket.c Fix bug where ECONNABORTED would have always occured on asocket_write. 2009-05-22 09:09:34 -07:00
adb_networking.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
array.c auto import from //branches/cupcake_rel/...@138607 2009-03-13 13:04:37 -07:00
ashmem-dev.c Added ashmem_get_size_region() function. 2009-06-02 00:55:30 +01:00
ashmem-host.c Added ashmem_get_size_region() function. 2009-06-02 00:55:30 +01:00
atomic-android-arm.S android_atomic_write() implementation was using cmpxchg which was useless 2009-09-03 16:31:37 -07:00
atomic-android-armv6.S android_atomic_write() implementation was using cmpxchg which was useless 2009-09-03 16:31:37 -07:00
atomic.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
buffer.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
buffer.h auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
config_utils.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
cpu_info.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
dir_hash.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
dlmalloc_stubs.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
hashmap.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
load_file.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
loghack.h auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
memory.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
memset32.S auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
mq.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
mspace.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
native_handle.c move native_handle stuff from master_gl 2009-05-20 17:22:13 -07:00
private.h auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
process_name.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
properties.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
record_stream.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
selector.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
socket_inaddr_any_server.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
socket_local.h auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
socket_local_client.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
socket_local_server.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
socket_loopback_client.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
socket_loopback_server.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
socket_network_client.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
strdup8to16.c auto import from //branches/cupcake_rel/...@138607 2009-03-13 13:04:37 -07:00
strdup16to8.c Fix a potential integer overflow bug that could result in memory overwrites. 2009-05-02 19:43:30 +02:00
threads.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
tzfile.h auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
tzstrftime.c Add support for "standalone months" to tztime's strftime(). 2009-05-14 17:22:20 -07:00
tztime.c Fix an infinite loop in time2sub. 2009-09-09 18:32:07 -07:00
uio.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
zygote.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00