Skip to content

Commit

Permalink
Adjust buffer size of source code loading
Browse files Browse the repository at this point in the history
Signed-off-by: HyukWoo Park <[email protected]>
  • Loading branch information
clover2123 authored and ksh8281 committed Mar 20, 2024
1 parent 01c1324 commit babcedc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/android/escargot/src/main/cpp/JNIGlobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static OptionalRef<StringRef> builtinHelperFileRead(OptionalRef<ExecutionStateRe
return src;
} else {
if (state) {
const size_t maxNameLength = 990;
const size_t maxNameLength = 980;
if ((strnlen(builtinName, maxNameLength) + strnlen(fileName, maxNameLength)) < maxNameLength) {
char msg[1024];
snprintf(msg, sizeof(msg), "GlobalObject.%s: cannot open file %s", builtinName, fileName);
Expand Down
2 changes: 1 addition & 1 deletion src/shell/Shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static OptionalRef<StringRef> builtinHelperFileRead(OptionalRef<ExecutionStateRe
return src;
} else {
if (state) {
const size_t maxNameLength = 990;
const size_t maxNameLength = 980;
if ((strnlen(builtinName, maxNameLength) + strnlen(fileName, maxNameLength)) < maxNameLength) {
char msg[1024];
snprintf(msg, sizeof(msg), "GlobalObject.%s: cannot open file %s", builtinName, fileName);
Expand Down

0 comments on commit babcedc

Please sign in to comment.