diff --git a/CHANGES b/CHANGES index ef5ba30..a174c5e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +Changes in 2.8.1 (April 5, 2024) +- Fixed out-of-bound memory access issue for large inputs (libsais64). + Changes in 2.8.0 (March 3, 2024) - Implemented permuted longest common prefix array (PLCP) construction of an integer array. - Fixed compilation error when compiling the library with OpenMP enabled. diff --git a/CMakeLists.txt b/CMakeLists.txt index d1ca4a9..377bae1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) -project(libsais VERSION 2.8.0 LANGUAGES C DESCRIPTION "libsais is a library for linear time suffix array, longest common prefix array and burrows wheeler transform construction based on induced sorting algorithm.") +project(libsais VERSION 2.8.1 LANGUAGES C DESCRIPTION "libsais is a library for linear time suffix array, longest common prefix array and burrows wheeler transform construction based on induced sorting algorithm.") set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) diff --git a/README.md b/README.md index 850bbb4..132e99b 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ The libsais provides simple C99 API to construct suffix array and Burrows-Wheele The libsais is released under the [Apache License Version 2.0](LICENSE "Apache license") ## Changes +* April 5, 2024 (2.8.1) + * Fixed out-of-bound memory access issue for large inputs (libsais64). * March 3, 2024 (2.8.0) * Implemented permuted longest common prefix array (PLCP) construction of an integer array. * Fixed compilation error when compiling the library with OpenMP enabled. @@ -180,4 +182,4 @@ The libsais reuses space allocated for suffix array during construction. Sometim | abac | 200000 | 0.002 sec ( 84.36 MB/s) | 0.003 sec ( 73.63 MB/s) | **+14.56%**| 0.002 sec ( 105.08 MB/s) | 0.002 sec ( 86.64 MB/s) | **+21.27%**| | test3 | 2097088 | 0.034 sec ( 61.54 MB/s) | 0.037 sec ( 56.45 MB/s) | **+9.03%**| 0.028 sec ( 75.76 MB/s) | 0.032 sec ( 64.93 MB/s) | **+16.68%**| -> * All other files from [Benchmarks](#benchmarks) above do not suffer from this fallbacks. \ No newline at end of file +> * All other files from [Benchmarks](#benchmarks) above do not suffer from this fallbacks. diff --git a/VERSION b/VERSION index 6533b66..dbe5900 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.8.0 \ No newline at end of file +2.8.1 diff --git a/include/libsais.h b/include/libsais.h index d05027c..58189ef 100644 --- a/include/libsais.h +++ b/include/libsais.h @@ -26,8 +26,8 @@ Please see the file LICENSE for full copyright information. #define LIBSAIS_VERSION_MAJOR 2 #define LIBSAIS_VERSION_MINOR 8 -#define LIBSAIS_VERSION_PATCH 0 -#define LIBSAIS_VERSION_STRING "2.8.0" +#define LIBSAIS_VERSION_PATCH 1 +#define LIBSAIS_VERSION_STRING "2.8.1" #ifdef _WIN32 #ifdef LIBSAIS_SHARED diff --git a/include/libsais16.h b/include/libsais16.h index 0971da2..0791468 100644 --- a/include/libsais16.h +++ b/include/libsais16.h @@ -26,8 +26,8 @@ Please see the file LICENSE for full copyright information. #define LIBSAIS16_VERSION_MAJOR 2 #define LIBSAIS16_VERSION_MINOR 8 -#define LIBSAIS16_VERSION_PATCH 0 -#define LIBSAIS16_VERSION_STRING "2.8.0" +#define LIBSAIS16_VERSION_PATCH 1 +#define LIBSAIS16_VERSION_STRING "2.8.1" #ifdef _WIN32 #ifdef LIBSAIS_SHARED diff --git a/include/libsais64.h b/include/libsais64.h index 1078eaa..8f3ac89 100644 --- a/include/libsais64.h +++ b/include/libsais64.h @@ -26,8 +26,8 @@ Please see the file LICENSE for full copyright information. #define LIBSAIS64_VERSION_MAJOR 2 #define LIBSAIS64_VERSION_MINOR 8 -#define LIBSAIS64_VERSION_PATCH 0 -#define LIBSAIS64_VERSION_STRING "2.8.0" +#define LIBSAIS64_VERSION_PATCH 1 +#define LIBSAIS64_VERSION_STRING "2.8.1" #ifdef _WIN32 #ifdef LIBSAIS_SHARED diff --git a/src/libsais64.c b/src/libsais64.c index 9637ee3..0474478 100644 --- a/src/libsais64.c +++ b/src/libsais64.c @@ -6304,7 +6304,7 @@ static sa_sint_t libsais64_main_32s_recursion(sa_sint_t * RESTRICT T, sa_sint_t sa_sint_t new_fs = (fs + fs + n + n) <= INT32_MAX ? (fs + fs + n) : INT32_MAX - n; if ((new_fs / k >= 4) || (new_fs >= fs)) { - libsais64_convert_inplace_64u_to_32u((uint32_t *)T, 0, n); + libsais64_convert_inplace_64u_to_32u((uint32_t *)(void *)T, 0, n); #if defined(LIBSAIS_OPENMP) sa_sint_t index = libsais_int_omp((int32_t *)T, (int32_t *)SA, (int32_t)n, (int32_t)k, (int32_t)new_fs, (int32_t)threads);