Last Comment Bug 789827 - Fix nullptr abuse in comm-central
: Fix nullptr abuse in comm-central
Status: RESOLVED FIXED
:
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: unspecified
: All All
: -- normal (vote)
: Thunderbird 18.0
Assigned To: Siddharth Agarwal [:sid0] (inactive)
:
:
Mentors:
Depends on:
Blocks: VC11
  Show dependency treegraph
 
Reported: 2012-09-09 13:28 PDT by Siddharth Agarwal [:sid0] (inactive)
Modified: 2012-09-18 10:46 PDT (History)
2 users (show)
standard8: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch v1 (9.70 KB, patch)
2012-09-09 13:28 PDT, Siddharth Agarwal [:sid0] (inactive)
standard8: review+
Details | Diff | Splinter Review

Description Siddharth Agarwal [:sid0] (inactive) 2012-09-09 13:28:59 PDT
Created attachment 659594 [details] [diff] [review]
patch v1

comm-central uses nullptr in areas where it shouldn't be used. This fixes those cases.
Comment 1 Masatoshi Kimura [:emk] 2012-09-16 21:29:36 PDT
>-          tmp = '%'; *end = nullptr;
>+          tmp = '%'; *end = NULL;
>         }
>         else if (end-1 > start && *(end-1) == '%')
>         {
>-          end -= 1; tmp = '%'; *end = nullptr;
>+          end -= 1; tmp = '%'; *end = NULL;
>         }
>         else if (end-2 > start && *(end-2) == '%')
>         {
>-          end -= 2; tmp = '%'; *end = nullptr;
>+          end -= 2; tmp = '%'; *end = NULL;
>         }
>         else
>         {
>-          tmp = *end; *end = nullptr;
>+          tmp = *end; *end = NULL;
|*end = 0;| or |*end = '\0';|. *end is not a pointer.
Comment 2 Mark Banner (:standard8, afk until Dec) 2012-09-18 10:38:10 PDT
Comment on attachment 659594 [details] [diff] [review]
patch v1

r=me with the change of END -> 0 for the "*end = " cases. I'll land this in a moment as the tree is busted with this.
Comment 3 Mark Banner (:standard8, afk until Dec) 2012-09-18 10:46:31 PDT
Checked in: https://hg.mozilla.org/comm-central/rev/d210f0b60e38

Note You need to log in before you can comment on or make changes to this bug.