-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread Safety Warning in XHR String #185
Comments
Both the mentioned, as well as a warning in the HTMLParser, seem to rely on external locks.
For the first warning, it is directly stated in a comment; for the second, the comment refers to the function the taint-aware version was copied from. // Called under lock by function ptr
/* static */
nsresult nsHtml5StreamParser::CopySegmentsToParserNoTaint(
nsIInputStream* aInStream, void* aClosure, const char* aFromSegment,
uint32_t aToOffset, uint32_t aCount,
uint32_t* aWriteCount) MOZ_NO_THREAD_SAFETY_ANALYSIS {
nsHtml5StreamParser* parser = static_cast<nsHtml5StreamParser*>(aClosure);
parser->DoDataAvailable(AsBytes(Span(aFromSegment, aCount)), EmptyTaint);
// Assume DoDataAvailable consumed all available bytes.
*aWriteCount = aCount;
return NS_OK;
} This is the original, and the following is warned about: /* static */ nsresult
nsHtml5StreamParser::CopySegmentsToParser(
nsITaintawareInputStream *aInStream, void *aClosure, const char *aFromSegment,
uint32_t aToOffset, uint32_t aCount, const StringTaint& aTaint, uint32_t *aWriteCount) {
nsHtml5StreamParser* parser = static_cast<nsHtml5StreamParser*>(aClosure);
parser->DoDataAvailable(AsBytes(Span(aFromSegment, aCount)), aTaint); // <- warning here
// Assume DoDataAvailable consumed all available bytes.
*aWriteCount = aCount;
return NS_OK;
} So, I'd conclude it is sufficient to add the |
Thanks for looking into this! |
Closed by #197 |
There is a compiler warning about thread safety in the XHR String implementation.
The text was updated successfully, but these errors were encountered: