<p></p>
<p dir="auto"><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/techee/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/techee">@techee</a> so which part of <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/geany/geany/commit/d7c985e47412f8a53c5a8202a0f8b669c4fd5e08/hovercard" href="https://github.com/geany/geany/commit/d7c985e47412f8a53c5a8202a0f8b669c4fd5e08"><tt>d7c985e</tt></a> do you think is faulty, exactly?</p>
<p dir="auto">I changed <code>sci_get_text()</code> to account for scintilla writing 1 extra NUL byte, therefore I now pass <code>len - 1</code> to the API. The only in-core caller already allocates <code>sci_get_length() + 1</code> bytes. Also be aware that <code>sci_get_text()</code> is deprecated.</p>
<p dir="auto">I think I made a mistake in <code>sci_get_contents()</code> for the <code>buffer_len < 0</code> case. <code>sci_get_string()</code> won't do the right thing. But correcting that does not fix the crash. The only 2 in-core callers do pass <code>-1</code> for <code>buffer_len</code> so the other case doesn't matter for the crash.</p>
<p dir="auto">I'm not yet clear what exactly is causing the crash. At least the recipe provided by <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/elextr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/elextr">@elextr</a> also crashes for me regularly.</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/issues/3095#issuecomment-1010352238">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJY5QP5L5G6ABJZRIM3UVSKNRANCNFSM5LV3I2KA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJZH3MDTD545P22YL5TUVSKNRA5CNFSM5LV3I2KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHQ4MA3Q.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/issues/3095/1010352238</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/issues/3095#issuecomment-1010352238",
"url": "https://github.com/geany/geany/issues/3095#issuecomment-1010352238",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>