<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15029">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_stir_shaken: Use ast_asprintf for creating file path.<br><br>Change-Id: Ice5d92ecea2f1101c80487484f48ef98be2f1824<br>---<br>M res/res_stir_shaken.c<br>1 file changed, 3 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/29/15029/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_stir_shaken.c b/res/res_stir_shaken.c</span><br><span>index 3f79596..97fb177 100644</span><br><span>--- a/res/res_stir_shaken.c</span><br><span>+++ b/res/res_stir_shaken.c</span><br><span>@@ -462,9 +462,6 @@</span><br><span> </span><br><span>         /* If we don't have an entry in AstDB, CURL from the provided URL */</span><br><span>     if (ast_strlen_zero(file_path)) {</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-               size_t file_path_size;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>               /* Remove this entry from the database, since we will be</span><br><span>              * downloading a new file anyways.</span><br><span>            */</span><br><span>@@ -475,9 +472,9 @@</span><br><span> </span><br><span>                /* Set up the default path */</span><br><span>                filename = basename(public_key_url);</span><br><span style="color: hsl(0, 100%, 40%);">-            file_path_size = strlen(ast_config_AST_DATA_DIR) + 3 + strlen(STIR_SHAKEN_DIR_NAME) + strlen(filename) + 1;</span><br><span style="color: hsl(0, 100%, 40%);">-             file_path = ast_calloc(1, file_path_size);</span><br><span style="color: hsl(0, 100%, 40%);">-              snprintf(file_path, sizeof(*file_path), "%s/keys/%s/%s", ast_config_AST_DATA_DIR, STIR_SHAKEN_DIR_NAME, filename);</span><br><span style="color: hsl(120, 100%, 40%);">+          if (ast_asprintf(&file_path, "%s/keys/%s/%s", ast_config_AST_DATA_DIR, STIR_SHAKEN_DIR_NAME, filename) < 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span> </span><br><span>                /* Download to the default path */</span><br><span>           if (run_curl(public_key_url, file_path)) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15029">change 15029</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15029"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Ice5d92ecea2f1101c80487484f48ef98be2f1824 </div>
<div style="display:none"> Gerrit-Change-Number: 15029 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>