[Asterisk-code-review] sorcery: Add ast sorcery retrieve by prefix() (asterisk[master])

Corey Farrell asteriskteam at digium.com
Mon Nov 13 13:07:43 CST 2017


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/7164 )

Change subject: sorcery: Add ast_sorcery_retrieve_by_prefix()
......................................................................


Patch Set 2: Code-Review-1

(3 comments)

https://gerrit.asterisk.org/#/c/7164/2/res/res_sorcery_astdb.c
File res/res_sorcery_astdb.c:

https://gerrit.asterisk.org/#/c/7164/2/res/res_sorcery_astdb.c@341
PS2, Line 341: 	snprintf(tree, sizeof(tree), "%s%%", prefix);
Since we are passing prefix_len I assume it's possible that prefix[prefix_len] != '\0'.  I think you need to use:
snprintf(tree, sizeof(tree), "%.*s%%", prefix_len, prefix)


https://gerrit.asterisk.org/#/c/7164/2/res/res_sorcery_realtime.c
File res/res_sorcery_realtime.c:

https://gerrit.asterisk.org/#/c/7164/2/res/res_sorcery_realtime.c@272
PS2, Line 272: 	if (!ast_strlen_zero(prefix)) {
if (prefix_len && !ast_strlen_zero(prefix))


https://gerrit.asterisk.org/#/c/7164/2/res/res_sorcery_realtime.c@274
PS2, Line 274: 		snprintf(value, sizeof(value), "%s%%", prefix);
Same as astdb snprintf.



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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I56f4e20ba1154bd52281f995c27a429a854f6a79
Gerrit-Change-Number: 7164
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Comment-Date: Mon, 13 Nov 2017 19:07:43 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171113/5b270518/attachment.html>


More information about the asterisk-code-review mailing list