<p></p>
<p><b>@pnorman</b> approved this pull request.</p>

<p dir="auto">My estimate based on <a href="https://github.com/openstreetmap/mod_tile/issues/333#issuecomment-1724292120" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/mod_tile/issues/333/hovercard">gdb</a> is that 5% of the threads on an 80 core server are waiting for a lock, and this could help reduce that. It's not game changing, but a worthwhile improvement.</p><hr>

<p>In <a href="https://github.com/openstreetmap/mod_tile/pull/335#discussion_r1332628251">src/render_submit_queue.c</a>:</p>
<pre style='color:#555'>>      }
 
        pthread_cond_signal(&qCondNotFull);
        pthread_mutex_unlock(&qLock);
-       return cmd;
+
+       struct protocol * cmd = malloc(sizeof(struct protocol));;
+
+       cmd->ver = 2;
+       cmd->cmd = cmdRenderBulk;
+       cmd->z = e->z;
+       cmd->x = e->x;
+       cmd->y = e->y;
+       strncpy(cmd->xmlname, e->mapname, XMLCONFIG_MAX - 1);
</pre>
<p dir="auto">Since this existing code with no changes except indentation and position, I don't think CWE-120 is a blocker.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/mod_tile/pull/335#pullrequestreview-1637152376">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353UBXPTCTUHLOE73HMTX3PW6NANCNFSM6AAAAAA5BCH6QY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AA6353TNQFXTGUCOAQLPCRDX3PW6NA5CNFSM6AAAAAA5BCH6Q2WGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTTBST3HQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/mod_tile/pull/335/review/1637152376</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/mod_tile/pull/335#pullrequestreview-1637152376",
"url": "https://github.com/openstreetmap/mod_tile/pull/335#pullrequestreview-1637152376",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>