diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-11-05 13:53:55 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-11-07 16:54:02 +0100 |
commit | 619d144751e6685b24ded9029fe9c484c0494c30 (patch) | |
tree | 75788eb1f3e576a92b5c5d0c678cfda67e1df0d4 /include | |
parent | 8fa11a4df344f58375eb26b3b65004345f21ef37 (diff) |
eif: cope with huge section offsets
Check for overflow to avoid that fseek() receives a sign-extended value.
Cc: Dorjoy Chowdhury <dorjoychy111@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/qemu/osdep.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index fe7c3c5f67..fdff07fd99 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -297,6 +297,10 @@ void QEMU_ERROR("code path is reachable") #error building with G_DISABLE_ASSERT is not supported #endif +#ifndef OFF_MAX +#define OFF_MAX (sizeof (off_t) == 8 ? INT64_MAX : INT32_MAX) +#endif + #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif |