Skip to content

Commit

Permalink
Fix buffer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandezseb committed Dec 15, 2023
1 parent 4c5959c commit ce9073a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/VM/ConstantInstructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void loadConstant(VMThread* thread, u4 index, JavaHeap* heap)

u4 arrId = heap->createArray(AT_CHAR, strlen(utf8String));
Array* charArray = heap->getArray(arrId);
strcpy((char*)charArray->data, utf8String);
memcpy((char*)charArray->data, utf8String, strlen(utf8String));

Variable var = {};
var.type = VariableType_REFERENCE;
Expand Down

0 comments on commit ce9073a

Please sign in to comment.