FileTypes: Prevent a potential snprintf overflow.
This commit is contained in:
parent
fa146526b6
commit
19d1cffe33
@ -104,7 +104,7 @@ name_for_type(BString& string, type_code type, const char* displayAs)
|
||||
buffer[i] = '.';
|
||||
}
|
||||
|
||||
snprintf(buffer + 6, sizeof(buffer), " (0x%" B_PRIx32 ")", type);
|
||||
snprintf(buffer + 6, sizeof(buffer) - 6, " (0x%" B_PRIx32 ")", type);
|
||||
string = buffer;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user