[zeromq-dev] possible bug in zframe.c ?
Rodolfo Damas
damas.rodolfo at gmail.com
Thu Jun 20 07:38:11 CEST 2013
Laurent,
I don't see a problem with the code.. I'd think "..." and "" are just
literals with their own address allocated by compiler. 'elipsis' is just a
pointer that will point to one or the other depending on something else..
Bottom lne the compiler should assign(allocate) any string literals..
Cheers,
Rodolfo
On Tue, Jun 18, 2013 at 4:08 AM, Laurent Alebarde <l.alebarde at free.fr>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
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130620/256baf3b/attachment.htm>
More information about the zeromq-dev
mailing list