Fix overflow in aiString
parent
3c1d8850a4
commit
5a764fff04
|
@ -307,7 +307,7 @@ struct aiString {
|
|||
void Set(const char *sz) {
|
||||
const ai_int32 len = (ai_uint32)::strlen(sz);
|
||||
if (len > (ai_int32)MAXLEN - 1) {
|
||||
return;
|
||||
len = (ai_int32) MAXLEN - 1;
|
||||
}
|
||||
length = len;
|
||||
memcpy(data, sz, len);
|
||||
|
@ -321,7 +321,10 @@ struct aiString {
|
|||
}
|
||||
|
||||
length = rOther.length;
|
||||
;
|
||||
if (length >(MAXLEN - 1)) {
|
||||
length = (ai_int32) MAXLEN - 1;
|
||||
}
|
||||
|
||||
memcpy(data, rOther.data, length);
|
||||
data[length] = '\0';
|
||||
return *this;
|
||||
|
|
Loading…
Reference in New Issue