From 69da80395bf57503b3f21b9e2aadac396725a5ec Mon Sep 17 00:00:00 2001 From: Adam Velebil Date: Thu, 13 Apr 2017 20:47:00 +0200 Subject: [PATCH] Bug 1308100 - Replace PL_strlen/PL_strnlen with strlen/strnlen;r=erahm MozReview-Commit-ID: CGnzomkIsi5 *** Bug 1308100 - Replace PL_strlen/PL_strnlen with strlen/strnlen;r?erahm --HG-- extra : rebase_source : a14b1538ed91848ecd02fb4607bce4cb9b2ab7c4 --- media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c | 4 ++-- netwerk/cache2/CacheHashUtils.cpp | 1 - netwerk/wifi/nsWifiScannerSolaris.cpp | 4 ++-- security/certverifier/OCSPRequestor.cpp | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c index 49b87727110e..72e0dfbd6e69 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c @@ -458,7 +458,7 @@ static void sdp_attr_fmtp_invalid_value(sdp_t *sdp, const char *param_name, */ static sdp_result_e sdp_verify_attr_fmtp_telephone_event(char *fmtpVal) { - size_t len = PL_strlen(fmtpVal); + size_t len = fmtpVal ? strlen(fmtpVal) : 0; // make sure the basics are good: // - at least 1 character @@ -482,7 +482,7 @@ static sdp_result_e sdp_verify_attr_fmtp_telephone_event(char *fmtpVal) char *temp = PL_strtok_r(dtmf_tones, ",", &strtok_state); while (temp != NULL) { - len = PL_strlen(temp); + len = strlen(temp); if (len > 5) { // an example of a max size token is "11-15", so if the // token is longer than 5 it is bad diff --git a/netwerk/cache2/CacheHashUtils.cpp b/netwerk/cache2/CacheHashUtils.cpp index 1f816e34716d..c2c37e8a7086 100644 --- a/netwerk/cache2/CacheHashUtils.cpp +++ b/netwerk/cache2/CacheHashUtils.cpp @@ -38,7 +38,6 @@ CacheHash::Hash(const char *aData, uint32_t aSize, uint32_t aInitval) const uint8_t *k = reinterpret_cast(aData); uint32_t a, b, c, len; -// length = PL_strlen(key); /* Set up the internal state */ len = aSize; a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */ diff --git a/netwerk/wifi/nsWifiScannerSolaris.cpp b/netwerk/wifi/nsWifiScannerSolaris.cpp index 6fbfa0eb7770..408f2b059c2b 100644 --- a/netwerk/wifi/nsWifiScannerSolaris.cpp +++ b/netwerk/wifi/nsWifiScannerSolaris.cpp @@ -9,7 +9,6 @@ #include "nsComponentManagerUtils.h" #include "nsIMutableArray.h" -#include "plstr.h" #include #define DLADM_STRSIZE 256 @@ -50,7 +49,8 @@ do_parse_str(char *bssid_str, char *essid_str, char *strength) if (ap) { ap->setMac(mac_as_int); ap->setSignal(signal); - ap->setSSID(essid_str, PL_strnlen(essid_str, DLADM_STRSIZE)); + size_t len = essid_str ? strnlen(essid_str, DLADM_STRSIZE) : 0; + ap->setSSID(essid_str, len); } return ap; } diff --git a/security/certverifier/OCSPRequestor.cpp b/security/certverifier/OCSPRequestor.cpp index d0edede6fd72..b988ecefbc4e 100644 --- a/security/certverifier/OCSPRequestor.cpp +++ b/security/certverifier/OCSPRequestor.cpp @@ -86,7 +86,7 @@ DoOCSPRequest(const UniquePLArenaPool& arena, const char* url, if (!arena.get() || !url || !encodedRequest || !encodedRequest->data) { return Result::FATAL_ERROR_INVALID_ARGS; } - uint32_t urlLen = PL_strlen(url); + uint32_t urlLen = strlen(url); if (urlLen > static_cast(std::numeric_limits::max())) { return Result::FATAL_ERROR_INVALID_ARGS; }