[Github-comments] [geany/geany] segfault calling sci_get_length when dragging a file onto Geany when no other documents are open (Issue #2998)
xiota
notifications at xxxxx
Sat Nov 13 03:10:50 UTC 2021
I'm getting a segfault when calling `sci_get_length(editor->sci)` in a function responding to an `editor-notify` signal. This occurs only when dropping files into Geany when no documents are open (the only document is "untitled"). This problem does not occur when:
* Double clicking a file in the file manager
* Dragging a file when other documents are open
* Draggin a file after modifying the untitled document
Checking that `editor`, `editor->document`, and `editor->sci` are not `NULL` does not prevent the segfault.
```C
bool NewPluginClass::editor_notify(GObject *object, GeanyEditor *editor, SCNotification *nt, NewPluginClass *self) {
if (!self->enable || !DOC_VALID(editor->document) || !editor->document->changed) {
return false;
}
if (editor && editor->sci && sci_get_length(editor->sci) == 0) {
// testing
}
return false;
}
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2998
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211112/1850d240/attachment.htm>
More information about the Github-comments
mailing list