[Asterisk-code-review] res_http_media_cache: Do not crash when there is no extension (asterisk[20])

N A asteriskteam at digium.com
Fri Dec 16 07:53:15 CST 2022


Attention is currently required from: Holger Hans Peter Freyther.

N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/19717 )

Change subject: res_http_media_cache: Do not crash when there is no extension
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

Patchset:

PS1: 
This function is only used in one place. Should we even call file_extension_from_string if str is NULL to begin with?

I think it's reasonable for certain functions like this to expect a non-NULL argument. Maybe this should be handled in file_extension_from_url_path instead?

e.g. as an example:

const char *uri_path = ast_uri_path(uri);
buffer = uri_path ? file_extension_from_string(uri_path, buffer, capacity) ? NULL;



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19717
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 20
Gerrit-Change-Id: I6a9433688cb5d3d4be8758b7642d923bdde6c273
Gerrit-Change-Number: 19717
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Hans Peter Freyther <automatic at freyther.de>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: N A <asterisk at phreaknet.org>
Gerrit-Attention: Holger Hans Peter Freyther <automatic at freyther.de>
Gerrit-Comment-Date: Fri, 16 Dec 2022 13:53:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221216/8fe13462/attachment.html>


More information about the asterisk-code-review mailing list