Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
2e7e13af
Commit
2e7e13af
authored
Feb 14, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#185 fix out of range read from uint3korr
parent
567c09ad
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
9 deletions
+16
-9
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+3
-3
storage/tokudb/hatoku_cmp.cc
storage/tokudb/hatoku_cmp.cc
+5
-5
storage/tokudb/hatoku_cmp.h
storage/tokudb/hatoku_cmp.h
+1
-1
storage/tokudb/hatoku_defines.h
storage/tokudb/hatoku_defines.h
+7
-0
No files found.
storage/tokudb/ha_tokudb.cc
View file @
2e7e13af
...
@@ -665,7 +665,7 @@ static ulonglong retrieve_auto_increment(uint16 type, uint32 offset,const uchar
...
@@ -665,7 +665,7 @@ static ulonglong retrieve_auto_increment(uint16 type, uint32 offset,const uchar
break
;
break
;
case
HA_KEYTYPE_UINT24
:
case
HA_KEYTYPE_UINT24
:
unsigned_autoinc
=
(
ulonglong
)
uint3korr
(
key
);
unsigned_autoinc
=
(
ulonglong
)
tokudb_
uint3korr
(
key
);
break
;
break
;
case
HA_KEYTYPE_LONGLONG
:
case
HA_KEYTYPE_LONGLONG
:
...
@@ -994,7 +994,7 @@ static uchar* pack_toku_field_blob(
...
@@ -994,7 +994,7 @@ static uchar* pack_toku_field_blob(
length
=
uint2korr
(
from_mysql
);
length
=
uint2korr
(
from_mysql
);
break
;
break
;
case
(
3
):
case
(
3
):
length
=
uint3korr
(
from_mysql
);
length
=
tokudb_
uint3korr
(
from_mysql
);
break
;
break
;
case
(
4
):
case
(
4
):
length
=
uint4korr
(
from_mysql
);
length
=
uint4korr
(
from_mysql
);
...
...
storage/tokudb/hatoku_cmp.cc
View file @
2e7e13af
...
@@ -428,8 +428,8 @@ static inline int cmp_toku_int (uchar* a_buf, uchar* b_buf, bool is_unsigned, ui
...
@@ -428,8 +428,8 @@ static inline int cmp_toku_int (uchar* a_buf, uchar* b_buf, bool is_unsigned, ui
ret_val
=
a_num
-
b_num
;
ret_val
=
a_num
-
b_num
;
goto
exit
;
goto
exit
;
case
(
3
):
case
(
3
):
a_num
=
uint3korr
(
a_buf
);
a_num
=
tokudb_
uint3korr
(
a_buf
);
b_num
=
uint3korr
(
b_buf
);
b_num
=
tokudb_
uint3korr
(
b_buf
);
ret_val
=
a_num
-
b_num
;
ret_val
=
a_num
-
b_num
;
goto
exit
;
goto
exit
;
case
(
4
):
case
(
4
):
...
@@ -663,7 +663,7 @@ static inline uchar* pack_toku_varbinary(
...
@@ -663,7 +663,7 @@ static inline uchar* pack_toku_varbinary(
length
=
uint2korr
(
from_mysql
);
length
=
uint2korr
(
from_mysql
);
break
;
break
;
case
(
3
):
case
(
3
):
length
=
uint3korr
(
from_mysql
);
length
=
tokudb_
uint3korr
(
from_mysql
);
break
;
break
;
case
(
4
):
case
(
4
):
length
=
uint4korr
(
from_mysql
);
length
=
uint4korr
(
from_mysql
);
...
@@ -777,7 +777,7 @@ static inline uchar* pack_toku_blob(
...
@@ -777,7 +777,7 @@ static inline uchar* pack_toku_blob(
length
=
uint2korr
(
from_mysql
);
length
=
uint2korr
(
from_mysql
);
break
;
break
;
case
(
3
):
case
(
3
):
length
=
uint3korr
(
from_mysql
);
length
=
tokudb_
uint3korr
(
from_mysql
);
break
;
break
;
case
(
4
):
case
(
4
):
length
=
uint4korr
(
from_mysql
);
length
=
uint4korr
(
from_mysql
);
...
@@ -932,7 +932,7 @@ static inline uchar* pack_toku_varstring(
...
@@ -932,7 +932,7 @@ static inline uchar* pack_toku_varstring(
length
=
uint2korr
(
from_mysql
);
length
=
uint2korr
(
from_mysql
);
break
;
break
;
case
(
3
):
case
(
3
):
length
=
uint3korr
(
from_mysql
);
length
=
tokudb_
uint3korr
(
from_mysql
);
break
;
break
;
case
(
4
):
case
(
4
):
length
=
uint4korr
(
from_mysql
);
length
=
uint4korr
(
from_mysql
);
...
...
storage/tokudb/hatoku_cmp.h
View file @
2e7e13af
...
@@ -243,7 +243,7 @@ static inline uint32_t get_blob_field_len(
...
@@ -243,7 +243,7 @@ static inline uint32_t get_blob_field_len(
length
=
uint2korr
(
from_tokudb
);
length
=
uint2korr
(
from_tokudb
);
break
;
break
;
case
(
3
):
case
(
3
):
length
=
uint3korr
(
from_tokudb
);
length
=
tokudb_
uint3korr
(
from_tokudb
);
break
;
break
;
case
(
4
):
case
(
4
):
length
=
uint4korr
(
from_tokudb
);
length
=
uint4korr
(
from_tokudb
);
...
...
storage/tokudb/hatoku_defines.h
View file @
2e7e13af
...
@@ -497,4 +497,11 @@ static const char *tokudb_thd_get_proc_info(THD *thd) {
...
@@ -497,4 +497,11 @@ static const char *tokudb_thd_get_proc_info(THD *thd) {
return
thd
->
proc_info
;
return
thd
->
proc_info
;
}
}
// uint3korr reads 4 bytes and valgrind reports an error, so we use this function instead
static
uint
tokudb_uint3korr
(
const
uchar
*
a
)
{
uchar
b
[
4
]
=
{};
memcpy
(
b
,
a
,
3
);
return
uint3korr
(
b
);
}
#endif // _TOKUDB_PORTABILITY_H
#endif // _TOKUDB_PORTABILITY_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment