geanylua: Fix a few warnings and potential crashes#1471
Open
b4n wants to merge 4 commits intogeany:masterfrom
Open
geanylua: Fix a few warnings and potential crashes#1471b4n wants to merge 4 commits intogeany:masterfrom
b4n wants to merge 4 commits intogeany:masterfrom
Conversation
Member
b4n
commented
Jul 6, 2025
Fix potential crash if `glspi_close()` or `glspi_save()` are given invalid document filenames.
Fix potential crash passing an invalid document index to `glcpi_save()`, `glcpi_open()` or `glcpi_close()`.
xiota
approved these changes
Nov 5, 2025
Contributor
|
Looks good to merge. Tested with examples/work/01.edit-test-script.lua and following scripts: -- script 1
local files={}
for file in geany.documents()
do
table.insert(files,file)
end
if ( #files > 0 )
then
file=geany.choose("Choose a tab to activate:", files)
if (file)
then
geany.save(file)
geany.activate(file)
end
else
geany.message("No files!")
end-- script 2
if geany.save(-5) then
geany.status('save document -5')
else
geany.status('save document 2')
geany.save(2)
end
if geany.activate(-3) then
geany.status('activate third tab')
else
geany.status('activate fourth document')
geany.activate(4)
endScript 2 outputs following in status window: |
Contributor
|
Also, confirmed crash when unpatched and fixed when patched: geany.save('/tmp/does-not-exist.txt') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.