mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-04-05 20:31:00 +08:00
patch from Brett Hutley posted 2008-07-24. Bounds check binding of memo field in JET3 when not using iconv.
This commit is contained in:
parent
42cf5030fd
commit
ae9fe1f304
@ -82,8 +82,11 @@ mdb_unicode2ascii(MdbHandle *mdb, char *src, size_t slen, char *dest, size_t dle
|
||||
dlen -= len_out;
|
||||
#else
|
||||
if (IS_JET3(mdb)) {
|
||||
strncpy(out_ptr, in_ptr, len_in);
|
||||
dlen = len_in;
|
||||
size_t copy_len = len_in;
|
||||
if (copy_len > dlen)
|
||||
copy_len = dlen;
|
||||
strncpy(out_ptr, in_ptr, copy_len);
|
||||
dlen = copy_len;
|
||||
} else {
|
||||
/* rough UCS-2LE to ISO-8859-1 conversion */
|
||||
unsigned int i;
|
||||
|
Loading…
Reference in New Issue
Block a user