*fixed a memory overflow bug with the ASC statement.
This commit is contained in:
parent
c94ffc7da9
commit
5f440b66b8
3
HISTORY
3
HISTORY
@ -1,3 +1,6 @@
|
||||
Mar. 8 2016
|
||||
Fixed a memory overflow bug with the ASC statement
|
||||
|
||||
Mar. 4 2016
|
||||
Fixed a memory leak with sub routine parameter
|
||||
Improved inputer
|
||||
|
@ -14654,6 +14654,7 @@ static int _std_asc(mb_interpreter_t* s, void** l) {
|
||||
int result = MB_FUNC_OK;
|
||||
char* arg = 0;
|
||||
int_t val = 0;
|
||||
size_t sz = 0;
|
||||
|
||||
mb_assert(s && l);
|
||||
|
||||
@ -14668,7 +14669,9 @@ static int _std_asc(mb_interpreter_t* s, void** l) {
|
||||
|
||||
goto _exit;
|
||||
}
|
||||
memcpy(&val, arg, strlen(arg));
|
||||
sz = strlen(arg);
|
||||
if(sizeof(int_t) < sz) sz = sizeof(int_t);
|
||||
memcpy(&val, arg, sz);
|
||||
mb_check(mb_push_int(s, l, val));
|
||||
|
||||
_exit:
|
||||
|
Loading…
x
Reference in New Issue
Block a user