[Github-comments] [geany/geany-plugins] Splitting a snowman in half crashes Geany with Spell Check (inserting a space before Unicode VARIATION SELECTOR-16) (#1041)

Colomban Wendling notifications at xxxxx
Mon Dec 7 12:00:44 UTC 2020


@elextr for the moment your hint doesn't make much sense to me, you're just point out that a 0×H image will have 0 bytes of data, which makes sense.  I don't see how it would account for accessing past the buffer, as the given size is 0 in one direction.  Well, of course the can be a bug some other place, and likely is, but it makes perfect sense the data is 0 bytes.

Or maybe I'm just not C++-literate enough, but `&zeroLengthMemory[0]` should not cause any issue.  Though, maybe the problem is that `operator[0]` actually checks the value can be dereferenced, in which case it cannot…

Meh, writing this makes me think that either:
* with a C++ vector, `&vector[0]` is not equivalent to getting a raw pointer on the vector's data
* glibc++ has a bug in that it should not assert in this case (yet, I don't see how it could then assert for valid cases)

I don't think there is an actual bug in accessing the memory as Valgrind's memcheck doesn't report errors; so I guess the calling code (at which I didn't look) does not access the memeory past its size.
I guess we *could* special-case the code not to dereference, but that sounds weird to the C guy I am :)

-- 
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-plugins/issues/1041#issuecomment-739874149
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20201207/afc5503f/attachment-0001.htm>


More information about the Github-comments mailing list