aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/libb64/libb64/0004-Fix-off-by-one-error.patch
blob: e19dbad08d62ea00c69128c7bfaf66833ede7539 (plain)
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
26
From 8144fd9e02bd5ccd1e080297b19a1e9eb4d3ff96 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 27 Mar 2021 22:07:15 -0700
Subject: [PATCH] Fix off by one error

Launchpad bug #1501176 reported by William McCall on 2015-09-30

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/cdecode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cdecode.c b/src/cdecode.c
index 4e47e9f..45da4e1 100644
--- a/src/cdecode.c
+++ b/src/cdecode.c
@@ -13,7 +13,7 @@ int base64_decode_value(char value_in)
 	static const char decoding_size = sizeof(decoding);
 	if (value_in < 43) return -1;
 	value_in -= 43;
-	if (value_in > decoding_size) return -1;
+	if (value_in >= decoding_size) return -1;
 	return decoding[(int)value_in];
 }