Projects
Factory:RISC-V:Base
util-linux
_service:tar_scm:backport-iso9660.h-avoid-undef...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-iso9660.h-avoid-undefined-signed-integer-shift.patch of Package util-linux
From 893fe60d0b8f14d9a3022f6f95637e43b17f1b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de> Date: Tue, 13 Dec 2022 02:40:02 +0000 Subject: [PATCH] iso9660.h: avoid undefined signed integer shift When the high bit in p[3] is set we would overflow our signed 4-byte integer result value. Force an unsigned type instead. --- include/iso9660.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/iso9660.h b/include/iso9660.h index cbc45dbb4..ed402d8c8 100644 --- a/include/iso9660.h +++ b/include/iso9660.h @@ -34,7 +34,7 @@ static inline uint32_t isonum_731(const unsigned char *p) return ((p[0] & 0xff) | ((p[1] & 0xff) << 8) | ((p[2] & 0xff) << 16) - | ((p[3] & 0xff) << 24)); + | (((uint32_t) p[3] & 0xff) << 24)); } static inline uint32_t isonum_732(const unsigned char *p) @@ -42,7 +42,7 @@ static inline uint32_t isonum_732(const unsigned char *p) return ((p[3] & 0xff) | ((p[2] & 0xff) << 8) | ((p[1] & 0xff) << 16) - | ((p[0] & 0xff) << 24)); + | (((uint32_t) p[0] & 0xff) << 24)); } static inline uint32_t isonum_733(const unsigned char *p, bool check_match) -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2