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:
@@ -1317,7 +1317,7 @@ StyledEditWindow::_LoadFile(entry_ref* ref)
|
|||||||
BEntry entry(ref, true);
|
BEntry entry(ref, true);
|
||||||
char name[B_FILE_NAME_LENGTH];
|
char name[B_FILE_NAME_LENGTH];
|
||||||
if (entry.GetName(name) != B_OK)
|
if (entry.GetName(name) != B_OK)
|
||||||
strcpy(name, B_TRANSLATE("???"));
|
strncpy(name, B_TRANSLATE("???"), sizeof(name));
|
||||||
|
|
||||||
BString text;
|
BString text;
|
||||||
if (status == B_BAD_TYPE)
|
if (status == B_BAD_TYPE)
|
||||||
|
|||||||
Reference in New Issue
Block a user