[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kexi/3.1] src/migration/mdb/3rdparty/mdbtools/libmdb: Bug fix for 'bad' data with odd number of UCS
From: Jaroslaw Staniek <null () kde ! org>
Date: 2018-08-30 21:19:24
Message-ID: E1fvULc-0003tX-Vm () code ! kde ! org
[Download RAW message or body]
Git commit 410db4e376239bdf491e2fdf834b2ef04d78d052 by Jaroslaw Staniek, on behalf of \
Brian Bruns. Committed on 30/08/2018 at 21:02.
Pushed by staniek into branch '3.1'.
Bug fix for 'bad' data with odd number of UCS-2 bytes
BUG:396984
mdbtools 9d56b0c3d80cdabc21b
M +7 -0 src/migration/mdb/3rdparty/mdbtools/libmdb/iconv.c
https://commits.kde.org/kexi/410db4e376239bdf491e2fdf834b2ef04d78d052
diff --git a/src/migration/mdb/3rdparty/mdbtools/libmdb/iconv.c \
b/src/migration/mdb/3rdparty/mdbtools/libmdb/iconv.c index ee20ae3ce..a62d6161d \
100644
--- a/src/migration/mdb/3rdparty/mdbtools/libmdb/iconv.c
+++ b/src/migration/mdb/3rdparty/mdbtools/libmdb/iconv.c
@@ -74,6 +74,13 @@ mdb_unicode2ascii(MdbHandle *mdb, char *src, size_t slen, char \
*dest, size_t dle //printf("1 len_in %d len_out %d\n",len_in, len_out);
while (1) {
iconv(mdb->iconv_in, &in_ptr, &len_in, &out_ptr, &len_out);
+ /*
+ * Have seen database with odd number of bytes in UCS-2, shouldn't happen but \
protect against it + */
+ if (!IS_JET3(mdb) && len_in<=1) {
+ //fprintf(stderr, "Detected invalid number of UCS-2 bytes\n");
+ break;
+ }
if ((!len_in) || (errno == E2BIG)) break;
/* Don't bail if impossible conversion is encountered */
in_ptr += (IS_JET3(mdb)) ? 1 : 2;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic