[Asterisk-code-review] ast json pack(): Use safer json ref mechanism. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Mon Dec 18 18:18:30 CST 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/7637 )

Change subject: ast_json_pack(): Use safer json ref mechanism.
......................................................................


Patch Set 1:

> I prefer the reference stealing form but what makes it safer?

The ast_json_pack() uses json_vpack_ex().  When json_vpack_ex() gets its own ref for the 'O' option it uses the internal ref function which is not thread safe.  Though if there happens to be an OOM error packing the json object, it will use the internal unref function which is not thread safe either.  However, the OOM case should be quite rare.  Who runs out of memory. :)


-- 
To view, visit https://gerrit.asterisk.org/7637
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I49204db2e57ae96eee43909c18ed007c09ac817e
Gerrit-Change-Number: 7637
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Tue, 19 Dec 2017 00:18:30 +0000
Gerrit-HasComments: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171218/a06b269e/attachment.html>


More information about the asterisk-code-review mailing list