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:
Ryan Leavengood 2010-12-29 05:16:42 +00:00
parent 5d67e2ba05
commit ccb228004c

View File

@ -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)