diff --git a/netwerk/base/Predictor.cpp b/netwerk/base/Predictor.cpp index 1324e67ca..a04b4e2b0 100644 --- a/netwerk/base/Predictor.cpp +++ b/netwerk/base/Predictor.cpp @@ -49,6 +49,9 @@ static const int32_t ANDROID_23_VERSION = 10; #endif +#include "mozilla-config.h" +#include "plvmx.h" + using namespace mozilla; namespace mozilla { @@ -1683,7 +1686,7 @@ Predictor::ParseMetaDataEntry(const char *key, const char *value, nsIURI **uri, PREDICTOR_LOG(("Predictor::ParseMetaDataEntry key=%s value=%s", key ? key : "", value)); - const char *comma = strchr(value, ','); + const char *comma = VMX_STRCHR(value, ','); if (!comma) { PREDICTOR_LOG((" could not find first comma")); return false; @@ -1699,7 +1702,7 @@ Predictor::ParseMetaDataEntry(const char *key, const char *value, nsIURI **uri, } value = comma + 1; - comma = strchr(value, ','); + comma = VMX_STRCHR(value, ','); if (!comma) { PREDICTOR_LOG((" could not find second comma")); return false; @@ -1709,7 +1712,7 @@ Predictor::ParseMetaDataEntry(const char *key, const char *value, nsIURI **uri, PREDICTOR_LOG((" hitCount -> %u", hitCount)); value = comma + 1; - comma = strchr(value, ','); + comma = VMX_STRCHR(value, ','); if (!comma) { PREDICTOR_LOG((" could not find third comma")); return false; diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index 351e930c8..e592d871e 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -66,6 +66,9 @@ #include +#include "mozilla-config.h" +#include "plvmx.h" + nsresult /*NS_NewChannelWithNodeAndTriggeringPrincipal */ NS_NewChannelWithTriggeringPrincipal(nsIChannel **outChannel, nsIURI *aUri, @@ -2133,7 +2136,7 @@ nsresult NS_GenerateHostPort(const nsCString& host, int32_t port, nsACString &hostLine) { - if (strchr(host.get(), ':')) { + if (VMX_STRCHR(host.get(), ':')) { // host is an IPv6 address literal and must be encapsulated in []'s hostLine.Assign('['); // scope id is not needed for Host header. diff --git a/netwerk/base/nsProtocolProxyService.cpp b/netwerk/base/nsProtocolProxyService.cpp index 593d0af3f..6f3b54fb4 100644 --- a/netwerk/base/nsProtocolProxyService.cpp +++ b/netwerk/base/nsProtocolProxyService.cpp @@ -34,6 +34,9 @@ #include "nsINetworkLinkService.h" #include "nsIHttpChannelInternal.h" +#include "mozilla-config.h" +#include "plvmx.h" + //---------------------------------------------------------------------------- namespace mozilla { @@ -916,7 +919,7 @@ nsProtocolProxyService::ExtractProxyInfo(const char *start, // www.example.com:8080 if (start < end) { host = start; - hostEnd = strchr(host, ':'); + hostEnd = VMX_STRCHR(host, ':'); if (!hostEnd || hostEnd > end) { hostEnd = end; // no port, so assume default diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index 5c985acd8..e88af0fd2 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -25,6 +25,9 @@ #include "mozilla/dom/EncodingUtils.h" #include "nsContentUtils.h" +#include "mozilla-config.h" +#include "plvmx.h" + using mozilla::dom::EncodingUtils; using namespace mozilla::ipc; @@ -1695,7 +1698,7 @@ nsStandardURL::SetHost(const nsACString &input) // For consistency with SetSpec/nsURLParsers, don't allow spaces // in the hostname. - if (strchr(host, ' ')) + if (VMX_STRCHR(host, ' ')) return NS_ERROR_MALFORMED_URI; InvalidateCache(); @@ -2194,7 +2197,7 @@ nsStandardURL::Resolve(const nsACString &in, nsACString &out) // locate result path resultPath = PL_strstr(result, "://"); if (resultPath) { - resultPath = PL_strchr(resultPath + 3, '/'); + resultPath = VMX_STRCHR(resultPath + 3, '/'); if (resultPath) net_CoalesceDirs(coalesceFlag,resultPath); } diff --git a/netwerk/base/nsURLParsers.cpp b/netwerk/base/nsURLParsers.cpp index 58b2096ee..51bf5540d 100644 --- a/netwerk/base/nsURLParsers.cpp +++ b/netwerk/base/nsURLParsers.cpp @@ -665,7 +665,7 @@ nsStdURLParser::ParseAfterScheme(const char *spec, int32_t specLen, const char *end = spec + specLen; const char *p; for (p = spec + nslash; p < end; ++p) { - if (strchr("/?#;", *p)) + if (VMX_STRCHR("/?#;", *p)) break; } switch (nslash) { diff --git a/netwerk/mime/nsMIMEHeaderParamImpl.cpp b/netwerk/mime/nsMIMEHeaderParamImpl.cpp index a23d9e907..0a73a00a6 100644 --- a/netwerk/mime/nsMIMEHeaderParamImpl.cpp +++ b/netwerk/mime/nsMIMEHeaderParamImpl.cpp @@ -24,6 +24,9 @@ #include "nsIUnicodeDecoder.h" #include "mozilla/dom/EncodingUtils.h" +#include "mozilla-config.h" +#include "plvmx.h" + using mozilla::dom::EncodingUtils; // static functions declared below are moved from mailnews/mime/src/comi18n.cpp @@ -558,8 +561,8 @@ nsMIMEHeaderParamImpl::DoParameterInternal(const char *aHeaderValue, // in quotes (quotes required even if lang is blank) if (caseB || (caseCStart && acceptContinuations)) { // look for single quotation mark(') - const char *sQuote1 = PL_strchr(valueStart, 0x27); - const char *sQuote2 = sQuote1 ? PL_strchr(sQuote1 + 1, 0x27) : nullptr; + const char *sQuote1 = VMX_STRCHR(valueStart, 0x27); + const char *sQuote2 = sQuote1 ? VMX_STRCHR(sQuote1 + 1, 0x27) : nullptr; // Two single quotation marks must be present even in // absence of charset and lang. @@ -750,7 +753,7 @@ internalDecodeRFC2047Header(const char* aHeaderVal, const char* aDefaultCharset, Is7bitNonAsciiString(aHeaderVal, strlen(aHeaderVal))))) { DecodeRFC2047Str(aHeaderVal, aDefaultCharset, aOverrideCharset, aResult); } else if (aEatContinuations && - (PL_strchr(aHeaderVal, '\n') || PL_strchr(aHeaderVal, '\r'))) { + (VMX_STRCHR(aHeaderVal, '\n') || VMX_STRCHR(aHeaderVal, '\r'))) { aResult = aHeaderVal; } else { aEatContinuations = false; @@ -1191,7 +1194,7 @@ nsresult DecodeRFC2047Str(const char *aHeader, const char *aDefaultCharset, if (isLastEncodedWord) { // See if it's all whitespace. for (q = begin; q < p; ++q) { - if (!PL_strchr(" \t\r\n", *q)) break; + if (!VMX_STRCHR(" \t\r\n", *q)) break; } } @@ -1217,7 +1220,7 @@ nsresult DecodeRFC2047Str(const char *aHeader, const char *aDefaultCharset, charsetStart = p; charsetEnd = 0; for (q = p; *q != '?'; q++) { - if (*q <= ' ' || PL_strchr(especials, *q)) { + if (*q <= ' ' || VMX_STRCHR(especials, *q)) { goto badsyntax; } diff --git a/netwerk/protocol/data/nsDataHandler.cpp b/netwerk/protocol/data/nsDataHandler.cpp index bad5964f3..91cbff091 100644 --- a/netwerk/protocol/data/nsDataHandler.cpp +++ b/netwerk/protocol/data/nsDataHandler.cpp @@ -10,6 +10,9 @@ #include "DataChannelChild.h" #include "plstr.h" +#include "mozilla-config.h" +#include "plvmx.h" + static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID); //////////////////////////////////////////////////////////////////////////////// @@ -168,8 +171,8 @@ nsDataHandler::ParseURI(nsCString& spec, buffer += 5; // First, find the start of the data - char *comma = strchr(buffer, ','); - char *hash = strchr(buffer, '#'); + char *comma = VMX_STRCHR(buffer, ','); + char *hash = VMX_STRCHR(buffer, '#'); if (!comma || (hash && hash < comma)) return NS_ERROR_MALFORMED_URI; @@ -195,7 +198,7 @@ nsDataHandler::ParseURI(nsCString& spec, contentCharset.AssignLiteral("US-ASCII"); } else { // everything else is content type - char *semiColon = (char *) strchr(buffer, ';'); + char *semiColon = (char *) VMX_STRCHR(buffer, ';'); if (semiColon) *semiColon = '\0'; diff --git a/netwerk/protocol/http/nsHttp.cpp b/netwerk/protocol/http/nsHttp.cpp index 0a372e99c..1c69ba684 100644 --- a/netwerk/protocol/http/nsHttp.cpp +++ b/netwerk/protocol/http/nsHttp.cpp @@ -13,6 +13,9 @@ #include "mozilla/HashFunctions.h" #include "nsCRT.h" +#include "mozilla-config.h" +#include "plvmx.h" + namespace mozilla { namespace net { @@ -281,9 +284,9 @@ nsHttp::FindToken(const char *input, const char *token, const char *seps) const char *inputEnd = input + inputLen - tokenLen; for (; input <= inputEnd; ++input) { if (PL_strncasecmp(input, token, tokenLen) == 0) { - if (input > inputTop && !strchr(seps, *(input - 1))) + if (input > inputTop && !VMX_STRCHR(seps, *(input - 1))) continue; - if (input < inputEnd && !strchr(seps, *(input + tokenLen))) + if (input < inputEnd && !VMX_STRCHR(seps, *(input + tokenLen))) continue; return input; } diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 0edaf1efb..d372882e5 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -92,6 +92,9 @@ #include "nsICompressConvStats.h" #include "mozilla/unused.h" +#include "mozilla-config.h" +#include "plvmx.h" + namespace mozilla { namespace net { namespace { @@ -3804,7 +3807,7 @@ nsHttpChannel::AssembleCacheKey(const char *spec, uint32_t postID, } // Strip any trailing #ref from the URL before using it as the key - const char *p = strchr(spec, '#'); + const char *p = VMX_STRCHR(spec, '#'); if (p) cacheKey.Append(spec, p - spec); else @@ -4450,7 +4453,7 @@ GetAuthType(const char *challenge, nsCString &authType) const char *p; // get the challenge type - if ((p = strchr(challenge, ' ')) != nullptr) + if ((p = VMX_STRCHR(challenge, ' ')) != nullptr) authType.Assign(challenge, p - challenge); else authType.Assign(challenge); diff --git a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp index f5adaeb79..f520bef76 100644 --- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp +++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp @@ -29,6 +29,9 @@ #include "nsIURL.h" #include "mozilla/Telemetry.h" +#include "mozilla-config.h" +#include "plvmx.h" + namespace mozilla { namespace net { @@ -498,7 +501,7 @@ nsHttpChannelAuthProvider::GetCredentials(const char *challenges, const char *p = eol + 1; // get the challenge string (LF separated -- see nsHttpHeaderArray) - if ((eol = strchr(p, '\n')) != nullptr) + if ((eol = VMX_STRCHR(p, '\n')) != nullptr) challenge.Assign(p, eol - p); else challenge.Assign(p); @@ -878,7 +881,7 @@ GetAuthType(const char *challenge, nsCString &authType) const char *p; // get the challenge type - if ((p = strchr(challenge, ' ')) != nullptr) + if ((p = VMX_STRCHR(challenge, ' ')) != nullptr) authType.Assign(challenge, p - challenge); else authType.Assign(challenge); @@ -975,7 +978,7 @@ nsHttpChannelAuthProvider::ParseRealm(const char *challenge, } else { // realm given without quotes - end = strchr(p, ' '); + end = VMX_STRCHR(p, ' '); if (end) realm.Assign(p, end - p); else diff --git a/netwerk/protocol/http/nsHttpChunkedDecoder.cpp b/netwerk/protocol/http/nsHttpChunkedDecoder.cpp index 1a5568f97..b894cc149 100644 --- a/netwerk/protocol/http/nsHttpChunkedDecoder.cpp +++ b/netwerk/protocol/http/nsHttpChunkedDecoder.cpp @@ -132,7 +132,7 @@ nsHttpChunkedDecoder::ParseChunkRemaining(char *buf, unsigned long parsedval; // could be 64 bit, could be 32 // ignore any chunk-extensions - if ((p = PL_strchr(buf, ';')) != nullptr) + if ((p = VMX_STRCHR(buf, ';')) != nullptr) *p = 0; // mChunkRemaining is an uint32_t! diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index d118a488d..0409bbcf1 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -71,6 +71,9 @@ #include "nsCocoaFeatures.h" #endif +#include "mozilla-config.h" +#include "plvmx.h" + //----------------------------------------------------------------------------- #include "mozilla/net/HttpChannelChild.h" #include "OptimizedFor.h" // 10.4Fx @@ -1687,9 +1690,9 @@ CanonicalizeLanguageTag(char *languageTag) bool isFirst = true; bool seenSingleton = false; while (*s != '\0') { - char *subTagEnd = strchr(s, '-'); + char *subTagEnd = VMX_STRCHR(s, '-'); if (subTagEnd == nullptr) { - subTagEnd = strchr(s, '\0'); + subTagEnd = VMX_STRCHR(s, '\0'); } if (isFirst) { diff --git a/netwerk/protocol/http/nsHttpHeaderArray.cpp b/netwerk/protocol/http/nsHttpHeaderArray.cpp index d557efa8b..599bc6f3e 100644 --- a/netwerk/protocol/http/nsHttpHeaderArray.cpp +++ b/netwerk/protocol/http/nsHttpHeaderArray.cpp @@ -11,6 +11,9 @@ #include "nsURLHelper.h" #include "nsIHttpHeaderVisitor.h" +#include "mozilla-config.h" +#include "plvmx.h" + namespace mozilla { namespace net { @@ -173,7 +176,7 @@ nsHttpHeaderArray::ParseHeaderLine(const char *line, // We skip over mal-formed headers in the hope that we'll still be able to // do something useful with the response. - char *p = (char *) strchr(line, ':'); + char *p = (char *) VMX_STRCHR(line, ':'); if (!p) { LOG(("malformed header [%s]: no colon\n", line)); return NS_OK; @@ -217,7 +220,7 @@ nsHttpHeaderArray::ParseHeaderSet(char *buffer) nsHttpAtom hdr; char *val; while (buffer) { - char *eof = strchr(buffer, '\r'); + char *eof = VMX_STRCHR(buffer, '\r'); if (!eof) { break; } diff --git a/netwerk/protocol/http/nsHttpResponseHead.cpp b/netwerk/protocol/http/nsHttpResponseHead.cpp index a0e8df68d..50e0a0418 100644 --- a/netwerk/protocol/http/nsHttpResponseHead.cpp +++ b/netwerk/protocol/http/nsHttpResponseHead.cpp @@ -14,6 +14,9 @@ #include "nsURLHelper.h" #include +#include "mozilla-config.h" +#include "plvmx.h" + namespace mozilla { namespace net { @@ -299,7 +302,7 @@ nsHttpResponseHead::ParseStatusLine(const char *line) // HTTP-Version ParseVersion(line); - if ((mVersion == NS_HTTP_VERSION_0_9) || !(line = PL_strchr(line, ' '))) { + if ((mVersion == NS_HTTP_VERSION_0_9) || !(line = VMX_STRCHR(line, ' '))) { mStatus = 200; AssignDefaultStatusText(); } @@ -312,7 +315,7 @@ nsHttpResponseHead::ParseStatusLine(const char *line) } // Reason-Phrase is whatever is remaining of the line - if (!(line = PL_strchr(line, ' '))) { + if (!(line = VMX_STRCHR(line, ' '))) { AssignDefaultStatusText(); } else @@ -770,7 +773,7 @@ nsHttpResponseHead::ParseVersion(const char *str) return; } - char *p = PL_strchr(str, '.'); + char *p = VMX_STRCHR(str, '.'); if (p == nullptr) { LOG(("mal-formed server version; assuming HTTP/1.0\n")); mVersion = NS_HTTP_VERSION_1_0; diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp index b6d2845e9..11918e33e 100644 --- a/netwerk/protocol/http/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -71,7 +71,7 @@ LogHeaders(const char *lineStart) buf.Assign(lineStart, endOfLine - lineStart); if (PL_strcasestr(buf.get(), "authorization: ") || PL_strcasestr(buf.get(), "proxy-authorization: ")) { - char *p = PL_strchr(PL_strchr(buf.get(), ' ') + 1, ' '); + char *p = VMX_STRCHR(VMX_STRCHR(buf.get(), ' ') + 1, ' '); while (p && *++p) *p = '*'; } diff --git a/netwerk/streamconv/converters/nsMultiMixedConv.cpp b/netwerk/streamconv/converters/nsMultiMixedConv.cpp index aaf2e7d53..f0c7a0d3d 100644 --- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp +++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp @@ -902,12 +902,12 @@ nsMultiMixedConv::OnStartRequest(nsIRequest *request, nsISupports *ctxt) { return NS_ERROR_FAILURE; } - bndry = strchr(bndry, '='); + bndry = VMX_STRCHR(bndry, '='); if (!bndry) return NS_ERROR_FAILURE; bndry++; // move past the equals sign - char *attrib = (char *) strchr(bndry, ';'); + char *attrib = (char *) VMX_STRCHR(bndry, ';'); if (attrib) *attrib = '\0'; nsAutoCString boundaryString(bndry); @@ -1219,7 +1219,7 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr, mResponseHead->ParseHeaderLine(tmpHeader.get()); } - char *colon = (char *) strchr(cursor, ':'); + char *colon = (char *) VMX_STRCHR(cursor, ':'); if (colon) { *colon = '\0'; nsAutoCString headerStr(cursor); @@ -1258,12 +1258,12 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr, // something like: Content-range: bytes 7000-7999/8000 char* tmpPtr; - tmpPtr = (char *) strchr(colon + 1, '/'); + tmpPtr = (char *) VMX_STRCHR(colon + 1, '/'); if (tmpPtr) *tmpPtr = '\0'; // pass the bytes-unit and the SP - char *range = (char *) strchr(colon + 2, ' '); + char *range = (char *) VMX_STRCHR(colon + 2, ' '); if (!range) return NS_ERROR_FAILURE; @@ -1275,7 +1275,7 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr, mByteRangeStart = mByteRangeEnd = 0; } else { - tmpPtr = (char *) strchr(range, '-'); + tmpPtr = (char *) VMX_STRCHR(range, '-'); if (!tmpPtr) return NS_ERROR_FAILURE; diff --git a/rdf/datasource/nsFileSystemDataSource.cpp b/rdf/datasource/nsFileSystemDataSource.cpp index 4fb1d98bc..ce152e5ee 100644 --- a/rdf/datasource/nsFileSystemDataSource.cpp +++ b/rdf/datasource/nsFileSystemDataSource.cpp @@ -40,6 +40,9 @@ #include "nsDirectoryServiceDefs.h" #endif +#include "mozilla-config.h" +#include "plvmx.h" + #define NS_MOZICON_SCHEME "moz-icon:" static const char kFileProtocol[] = "file://"; @@ -54,7 +57,7 @@ FileSystemDataSource::isFileURI(nsIRDFResource *r) if ((uri) && (!strncmp(uri, kFileProtocol, sizeof(kFileProtocol) - 1))) { // XXX HACK HACK HACK - if (!strchr(uri, '#')) + if (!VMX_STRCHR(uri, '#')) { isFileURIFlag = true; } diff --git a/security/manager/ssl/PublicKeyPinningService.cpp b/security/manager/ssl/PublicKeyPinningService.cpp index d6fcd0bf5..1926abf11 100644 --- a/security/manager/ssl/PublicKeyPinningService.cpp +++ b/security/manager/ssl/PublicKeyPinningService.cpp @@ -17,6 +17,9 @@ #include "seccomon.h" #include "sechash.h" +#include "mozilla-config.h" +#include "plvmx.h" + #include "StaticHPKPins.h" // autogenerated by genHPKPStaticpins.js using namespace mozilla; @@ -174,7 +177,7 @@ FindPinningInformation(const char* hostname, mozilla::pkix::Time time, char* evalHost = const_cast(hostname); char* evalPart; // Notice how the (xx = strchr) prevents pins for unqualified domain names. - while (!foundEntry && (evalPart = strchr(evalHost, '.'))) { + while (!foundEntry && (evalPart = VMX_STRCHR(evalHost, '.'))) { MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, ("pkpin: Querying pinsets for host: '%s'\n", evalHost)); // Attempt dynamic pins first