Bug 1039822 - Make sure FrameMetrics::mContentDescription is null-terminated after being read from IPC. r=kats

This commit is contained in:
Botond Ballo 2014-07-16 19:10:56 -04:00
parent 75d95947f6
commit dcc1836e1c

View File

@ -802,6 +802,7 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
// a pointer to the string in its internal buffer.
strncpy(aResult->mContentDescription, contentDescription,
sizeof(aResult->mContentDescription));
aResult->mContentDescription[sizeof(aResult->mContentDescription) - 1] = '\0';
return true;
}
};