CID 6931 and 8076: use strncpy for the extremely unlikely case that
B_TRANSLATE("???") returns something larger than the size of name. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40011 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
5d67e2ba05
commit
ccb228004c
@ -1317,7 +1317,7 @@ StyledEditWindow::_LoadFile(entry_ref* ref)
|
||||
BEntry entry(ref, true);
|
||||
char name[B_FILE_NAME_LENGTH];
|
||||
if (entry.GetName(name) != B_OK)
|
||||
strcpy(name, B_TRANSLATE("???"));
|
||||
strncpy(name, B_TRANSLATE("???"), sizeof(name));
|
||||
|
||||
BString text;
|
||||
if (status == B_BAD_TYPE)
|
||||
|
Loading…
Reference in New Issue
Block a user