mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 879924 - Don't shorten zero-length strings. r=derf
We were trying to strip the optional null terminator even when we knew there wasn't one there.
This commit is contained in:
parent
a07587452c
commit
d09bd7d346
@ -579,8 +579,10 @@ WaveReader::LoadListChunk(uint32_t aChunkSize,
|
||||
break;
|
||||
}
|
||||
|
||||
// Wrap the string, adjusting length to account for optional
|
||||
// null termination in the chunk.
|
||||
nsCString val(p, length);
|
||||
if (val[length - 1] == '\0') {
|
||||
if (length > 0 && val[length - 1] == '\0') {
|
||||
val.SetLength(length - 1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user