[Geany-devel] Weird Segfault Crash

Colomban Wendling lists.ban at xxxxx
Tue Jan 3 17:08:19 UTC 2012


Le 03/01/2012 14:36, Nick Treleaven a écrit :
> On 02/01/2012 15:54, Nick Treleaven wrote:
>> On 02/01/2012 14:33, Colomban Wendling wrote:
>>>> encodings_convert_to_utf8_from_charset(utf8_name, (gsize) -1, ...)
>>>> >
>>>> > Is it OK the cast a negative number to `gsize` and will it have the
>>>> > desired effect for that function? The `-1` here is supposed to tell
>>>> the
>>>> > encoding function that the string is nul terminated and is to be
>>>> > measured with `strlen()` IIUC.
>>> It's ugly, but AFAIK it'll work fine everywhere since it's casted back
>>> to gssize in that function. But you're right, it should definitely be a
>>> gssize parameter. Unfortunately this function is in the plugin API, and
>>> I'm not sure of the implications of changing that parameter's type...
>>
>> That should be fixed. I'm not sure whether it needs an ABI break or not
>> (guess not), but if the parameter can be -1 then make it gssize.
> 
> Now fixed in Git. I decided an ABI break wasn't needed.

OK, cool.  Let's just hope it don't lead to weird behavior, I'm still
not 100% sure of what would happen even though I'm quite confident it'll
work at least on x86 (and actually a test of mine shows it does on my
x86_64 box :) ).

Cheers,
Colomban



More information about the Devel mailing list