• Arthur O'Dwyer's avatar
    The "count_" out-parameter is doubled instead of unchanged. · a48751b3
    Arthur O'Dwyer authored
    Static analysis says:
    src\zmq.cpp(489): error V220: Suspicious sequence of types castings: memsize -> 32-bit integer -> memsize. The value being casted: '* count_'.
    src\zmq.cpp(510): error V127: An overflow of the 32-bit 'nread' variable is possible inside a long cycle which utilizes a memsize-type loop counter.
    
    I've silenced the warning on line 489 and ignored the other.
    But also, it looks to me like there's a serious bug here: The
    out-parameter "count_" is never set to zero before we start
    incrementing it. So its final value will always be between
    1 and 2 times its initial value. The fix seems obvious.
    a48751b3
zmq.cpp 27.6 KB