<p></p>
<p dir="auto">Good point.</p>
<p dir="auto">I think it could be ok, <code>git_buf_grow</code> is called only once in the code directly and in all cases I've tested the <code>asize</code> field was non-zero, i.e. the <code>git_buf</code> instance was allocated by libgit2 and so the custom code in <code>gcb_git_buf_grow</code> was never used.</p>
<p dir="auto">However, either I'm wrong or there was a previous use case where this was necessary. As long as I don't know this, it's hard to say what's correct.<br>
Interestingly, newer versions of libgit2 (I think it was since 0.23 or so) even do not allow using <code>git_buf_grow</code> with a custom allocated buffer and raise an error instead. So if the plugin would use a custom allocated buffer, we probably would see errors (or at least warnings in the logs). Or I misunderstood the code.</p>
<p dir="auto">Anyway, I can't spend more time on this.</p>
<p dir="auto">Maybe someone else wants (<a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/b4n/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/b4n">@b4n</a>?).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany-plugins/pull/1165#issuecomment-1094357348">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ6MBIA5NYIWVVOHSVLVEMWUNANCNFSM5O4K4GKA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ7PVNSOTGBDTRDZ2ADVEMWUNA5CNFSM5O4K4GKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIE5JCZA.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><geany/geany-plugins/pull/1165/c1094357348</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/geany/geany-plugins/pull/1165#issuecomment-1094357348",
"url": "https://github.com/geany/geany-plugins/pull/1165#issuecomment-1094357348",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>