diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2010-09-18 05:53:14 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-09-18 05:53:14 +0000 |
commit | e50f0bf4743e3f405511e91ecc324ddf68c3c83d (patch) | |
tree | f5f3e4d75dc059a4b0529a9d6b8f2638e91c7a18 /linux-user | |
parent | 81e5ee58597a738971430438141dc7b6ebe07b25 (diff) | |
download | qemu-e50f0bf4743e3f405511e91ecc324ddf68c3c83d.tar.gz qemu-e50f0bf4743e3f405511e91ecc324ddf68c3c83d.tar.bz2 qemu-e50f0bf4743e3f405511e91ecc324ddf68c3c83d.zip |
linux-user: improve flatload error checking
Because of the use of unsigned type, possible errors during
load were ignored.
Fix by using a signed type.
This also avoids a warning with GCC flag -Wtype-limits.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/flatload.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/linux-user/flatload.c b/linux-user/flatload.c index 8ad130a2bd..8f9f4a5fcc 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -383,7 +383,8 @@ static int load_flat_file(struct linux_binprm * bprm, struct lib_info *libinfo, int id, abi_ulong *extra_stack) { struct flat_hdr * hdr; - abi_ulong textpos = 0, datapos = 0, result; + abi_ulong textpos = 0, datapos = 0; + abi_long result; abi_ulong realdatastart = 0; abi_ulong text_len, data_len, bss_len, stack_len, flags; abi_ulong memp = 0; /* for finding the brk area */ |