File 8e26ebd23ef9_Fixed_coverity_detected_defect_OOB_read.patch of Package OpenSceneGraph

From 8e26ebd23ef9c1184464712cf8559a1854e6cad7 Mon Sep 17 00:00:00 2001
From: Robert Osfield <robert@openscenegraph.com>
Date: Fri, 17 Jun 2016 10:57:17 +0100
Subject: [PATCH] =?UTF-8?q?Fixed=20coverity=20detected=20defect:=20Incorre?=
 =?UTF-8?q?ct=20values=20read=20from=20a=20different=20memory=20region=20w?=
 =?UTF-8?q?ill=20cause=20incorrect=20computations.=20In=20osgDB::=E2=80=8B?=
 =?UTF-8?q?base64=5Fdecode=5Fvalue(char):=20Out-of-bounds=20read=20from=20?=
 =?UTF-8?q?a=20buffer?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/osgDB/ConvertBase64.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/osgDB/ConvertBase64.cpp b/src/osgDB/ConvertBase64.cpp
index 50befdf66d..3f5c1c7e83 100644
--- a/src/osgDB/ConvertBase64.cpp
+++ b/src/osgDB/ConvertBase64.cpp
@@ -31,7 +31,7 @@ namespace osgDB
         static const char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
         static const char decoding_size = sizeof(decoding);
         value_in -= 43;
-        if (value_in < 0 || value_in > decoding_size) return -1;
+        if (value_in < 0 || value_in >= decoding_size) return -1;
         return decoding[(int)value_in];
     }
openSUSE Build Service is sponsored by