Skip to content

Commit 2cf0bf5

Browse files
authored
Correct OOB read (#323)
* Correct OOB read * Record PR number
1 parent a36778d commit 2cf0bf5

File tree

7 files changed

+21
-8
lines changed

7 files changed

+21
-8
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ include (utils.cmake)
55
disallow_intree_builds()
66

77
# API version - be sure to update utf8proc.h and Makefile, too!
8-
project (utf8proc VERSION 2.11.2 LANGUAGES C)
8+
project (utf8proc VERSION 2.11.3 LANGUAGES C)
99

1010
# This is the ABI version number, which may differ from the
1111
# API version number (defined in utf8proc.h and above).
1212
# Be sure to also update these in Makefile and MANIFEST!
1313
set(SO_MAJOR 3)
1414
set(SO_MINOR 2)
15-
set(SO_PATCH 2)
15+
set(SO_PATCH 3)
1616

1717
option(UTF8PROC_INSTALL "Enable installation of utf8proc" On)
1818
option(UTF8PROC_ENABLE_TESTING "Enable testing of utf8proc" Off)

MANIFEST

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ include/
22
include/utf8proc.h
33
lib/
44
lib/libutf8proc.a
5-
lib/libutf8proc.so -> libutf8proc.so.3.2.2
6-
lib/libutf8proc.so.2 -> libutf8proc.so.3.2.2
7-
lib/libutf8proc.so.3.2.2
5+
lib/libutf8proc.so -> libutf8proc.so.3.2.3
6+
lib/libutf8proc.so.2 -> libutf8proc.so.3.2.3
7+
lib/libutf8proc.so.3.2.3
88
lib/pkgconfig/
99
lib/pkgconfig/libutf8proc.pc

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ SOFLAG = -Wl,-soname
2424
# Be sure to also update these ABI versions in MANIFEST and CMakeLists.txt!
2525
MAJOR=3
2626
MINOR=2
27-
PATCH=2
27+
PATCH=3
2828

2929
# api version (also in utf8proc.h and CMakeLists.txt)
30-
VERSION=2.11.2
30+
VERSION=2.11.3
3131

3232
OS := $(shell uname)
3333
ifeq ($(OS),Darwin) # MacOS X

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# utf8proc release history #
22

3+
## Version 2.11.3 ##
4+
5+
2025-12-21
6+
7+
- Correct out-of-bounds memory access when calling `utf8proc_map` with both `UTF8PROC_CHARBOUND` and `UTF8PROC_COMPOSE` ([#323]).
8+
39
## Version 2.11.2 ##
410

511
2025-11-22

test/fuzzer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,8 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
9393
utf8proc_map(data, len, &str, UTF8PROC_CHARBOUND | UTF8PROC_DECOMPOSE);
9494
free(str);
9595

96+
utf8proc_map(data, len, &str, UTF8PROC_CHARBOUND | UTF8PROC_COMPOSE);
97+
free(str);
98+
9699
return 0;
97100
}

utf8proc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,10 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_normalize_utf32(utf8proc_int32_t *b
662662
utf8proc_ssize_t wpos = 0;
663663
for (rpos = 0; rpos < length; rpos++) {
664664
utf8proc_int32_t current_char = buffer[rpos];
665+
if (current_char < 0) {
666+
/* skip grapheme break */
667+
continue;
668+
}
665669
const utf8proc_property_t *current_property = unsafe_get_property(current_char);
666670
if (starter && current_property->combining_class > max_combining_class) {
667671
/* combination perhaps possible */

utf8proc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
/** The MINOR version number (increased when new functionality is added in a backwards-compatible manner). */
7474
#define UTF8PROC_VERSION_MINOR 11
7575
/** The PATCH version (increased for fixes that do not change the API). */
76-
#define UTF8PROC_VERSION_PATCH 2
76+
#define UTF8PROC_VERSION_PATCH 3
7777
/** @} */
7878

7979
#include <stdlib.h>

0 commit comments

Comments
 (0)