Files
francis.wang 4c86c082a2 Initial commit: OpenWrt-Yocto monorepo
Combine poky (Yocto scarthgap), meta-openembedded (scarthgap), and
meta-openwrt into a single repository.

Components:
- poky/             Yocto core framework (BitBake + OE-Core)
- meta-openembedded/ Community layers (meta-oe, meta-python, meta-networking)
- meta-openwrt/     OpenWrt customization layer
- setup-env.sh      One-click build environment setup
- README.md         Project documentation
2026-07-11 13:28:01 +08:00

42 lines
1.4 KiB
Diff

From 2f5582340ac3fd2062d0f6561a13aa9b269062dd Mon Sep 17 00:00:00 2001
From: Jakub Jelen <jjelen@redhat.com>
Date: Tue, 18 Nov 2025 14:13:59 +0100
Subject: [PATCH] compacttlv: Fix possible buffer overrun
Fixes: GHSA-72x5-fwjx-2459
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit a20b91adc2fc66785c0df98abc8ef456c0eaab9d)
CVE: CVE-2025-66038
Upstream-Status: Backport [https://github.com/OpenSC/OpenSC/commit/a20b91adc2fc66785c0df98abc8ef456c0eaab9d]
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
src/libopensc/sc.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/libopensc/sc.c b/src/libopensc/sc.c
index 7c9e0d25e..eb88b9abe 100644
--- a/src/libopensc/sc.c
+++ b/src/libopensc/sc.c
@@ -1082,13 +1082,15 @@ const u8 *sc_compacttlv_find_tag(const u8 *buf, size_t len, u8 tag, size_t *outl
size_t expected_len = tag & 0x0F;
for (idx = 0; idx < len; idx++) {
- if ((buf[idx] & 0xF0) == plain_tag && idx + expected_len < len &&
- (expected_len == 0 || expected_len == (buf[idx] & 0x0F))) {
+ u8 ctag = buf[idx] & 0xF0;
+ size_t ctag_len = buf[idx] & 0x0F;
+ if (ctag == plain_tag && idx + ctag_len < len &&
+ (expected_len == 0 || expected_len == ctag_len)) {
if (outlen != NULL)
- *outlen = buf[idx] & 0x0F;
+ *outlen = ctag_len;
return buf + (idx + 1);
}
- idx += (buf[idx] & 0x0F);
+ idx += ctag_len;
}
}
return NULL;