Dunno what the surrounding code is, but those are string literals right,
they do not need any allocation. They are saved in the program as static
data.

The problem is to do something like

char *s;
strcpy(s, other_string);

At that moment there is no place allocated for other_string in s.

Cheers,
Ondra Kupka


On Tue, Jun 18, 2013 at 10:11 AM, shancat <[email protected]> wrote:

> And it's supposed to be spelled ellipsis ;)
> On Jun 18, 2013 6:09 PM, "Laurent Alebarde" <[email protected]> wrote:
>
>>  Hi list,
>>
>> Studying the czmq library, I found a possible bug in zframe.c :
>>
>> ----- code begin ---------------
>>     const char *elipsis = "";
>>     if (size > max_size) {
>>         size = max_size;
>>         elipsis = "...";
>>     }
>> ----- code end ------------------
>>
>> I am not an expert, but it looks to me that the room for "..." has not
>> been allocated. If my analysis is correct, a possible correction would be:
>>
>> ----- code begin ---------------
>>     const char *elipsis = "...";
>>     if (size > max_size) {
>>         size = max_size;
>>     }
>>    else {
>>         elipsis = "";
>>    }
>> ----- code end ------------------
>>
>> Cheers,
>>
>>
>> Laurent
>>
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> [email protected]
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>>
> _______________________________________________
> zeromq-dev mailing list
> [email protected]
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to