Closed Bug 1342737 Opened 7 years ago Closed 7 years ago

Avoid using nsCRT.h and nsCRTGlue.h in PSM

Categories

(Core :: Security: PSM, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: Cykesiopka, Assigned: Cykesiopka)

References

Details

(Whiteboard: [psm-assigned])

Attachments

(1 file)

There are a few places where we can use the safer functionality provided by the Mozilla string classes instead.
Comment on attachment 8851203 [details]
Bug 1342737 - Avoid using nsCRT.h and nsCRTGlue.h in PSM.

https://reviewboard.mozilla.org/r/123574/#review126460

LGTM - just some nits.

::: commit-message-a5931:6
(Diff revision 1)
> +Bug 1342737 - Avoid using nsCRT.h and nsCRTGlue.h in PSM. r?keeler
> +
> +There are a few places where we can use the safer functionality provided by the
> +Mozilla string classes instead.
> +
> +Also fixes Bug 1268657.

nit: maybe briefly what that bug is so people don't have to go read it

::: security/manager/ssl/TransportSecurityInfo.cpp:213
(Diff revision 1)
>                              false, false, result);
>  }
>  
>  static nsresult
> -formatPlainErrorMessage(nsXPIDLCString const & host, int32_t port,
> +formatPlainErrorMessage(const nsCString& host, int32_t port,
>                          PRErrorCode err, 

nit: might be nice to remove some of these trailing spaces while we're in the area

::: security/manager/ssl/nsNSSIOLayer.cpp:26
(Diff revision 1)
>  #include "mozilla/Move.h"
>  #include "mozilla/Preferences.h"
>  #include "mozilla/Telemetry.h"
>  #include "nsArray.h"
>  #include "nsArrayUtils.h"
> +#include "nsCRT.h"

Er, wait, we need to add this here?
Attachment #8851203 - Flags: review?(dkeeler) → review+
Comment on attachment 8851203 [details]
Bug 1342737 - Avoid using nsCRT.h and nsCRTGlue.h in PSM.

https://reviewboard.mozilla.org/r/123574/#review126460

Thanks!

> nit: maybe briefly what that bug is so people don't have to go read it

Done.

> nit: might be nice to remove some of these trailing spaces while we're in the area

Done.

> Er, wait, we need to add this here?

This is here because the file still uses nsCRT for pref observation. Due to unified builds, it's probably not necessary to be here, but I added it just for correctness.
(One of these days I'll run IWYU on PSM and address all of these things at once...)
Pushed by ihsiao@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/420101b83dfc
Avoid using nsCRT.h and nsCRTGlue.h in PSM. r=keeler
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/420101b83dfc
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Blocks: 1268657
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: