Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
libplist.5282
libplist-boo1029707-base64-invalid-read.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libplist-boo1029707-base64-invalid-read.patch of Package libplist.5282
From e37ca0090343e0dae97e967d467bab56d502c37a Mon Sep 17 00:00:00 2001 From: Nikias Bassen <nikias@gmx.li> Date: Sat, 18 Feb 2017 18:09:34 +0100 Subject: [PATCH] base64: Prevent undefined shift when parsing invalid base64 encoded data Credit to OSS-Fuzz --- src/base64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/base64.c b/src/base64.c index ba8acca..ee02356 100644 --- a/src/base64.c +++ b/src/base64.c @@ -101,13 +101,13 @@ unsigned char *base64decode(const char *buf, size_t *size) w3 = tmpval[2]; w4 = tmpval[3]; - if (w2 >= 0) { + if (w1 >= 0 && w2 >= 0) { outbuf[p++] = (unsigned char)(((w1 << 2) + (w2 >> 4)) & 0xFF); } - if (w3 >= 0) { + if (w2 >= 0 && w3 >= 0) { outbuf[p++] = (unsigned char)(((w2 << 4) + (w3 >> 2)) & 0xFF); } - if (w4 >= 0) { + if (w3 >= 0 && w4 >= 0) { outbuf[p++] = (unsigned char)(((w3 << 6) + w4) & 0xFF); } } -- 2.12.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor