CID 6331, 6333, 6334, 6335 SECURE_CODING
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40677 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -333,7 +333,7 @@ query_for_app(const char* signature, entry_ref* appRef)
|
||||
else {
|
||||
// second pass, create a case insensitive query string
|
||||
char string[B_MIME_TYPE_LENGTH * 4];
|
||||
strcpy(string, "application/");
|
||||
strlcpy(string, "application/", sizeof(string));
|
||||
|
||||
int32 length = strlen(string);
|
||||
const char* from = signature + length;
|
||||
@@ -2496,7 +2496,7 @@ BRoster::_ResolveApp(const char* inType, entry_ref* ref,
|
||||
if (_appSig) {
|
||||
// there's no warranty, that appMeta is valid
|
||||
if (appMeta.IsValid())
|
||||
strcpy(_appSig, appMeta.Type());
|
||||
strlcpy(_appSig, appMeta.Type(), B_MIME_TYPE_LENGTH);
|
||||
else
|
||||
_appSig[0] = '\0';
|
||||
}
|
||||
@@ -2708,7 +2708,7 @@ BRoster::_TranslateType(const char* mimeType, BMimeType* appMeta,
|
||||
}
|
||||
} else {
|
||||
// The type is not installed. We assume it is an app signature.
|
||||
strcpy(primarySignature, mimeType);
|
||||
strlcpy(primarySignature, mimeType, sizeof(primarySignature));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2876,7 +2876,7 @@ BRoster::_GetFileType(const entry_ref* file, BNodeInfo* nodeInfo,
|
||||
if (!type.IsValid())
|
||||
return B_BAD_VALUE;
|
||||
|
||||
strcpy(mimeType, type.Type());
|
||||
strlcpy(mimeType, type.Type(), B_MIME_TYPE_LENGTH);
|
||||
}
|
||||
|
||||
return B_OK;
|
||||
|
||||
Reference in New Issue
Block a user