Patch Set 2:
(1 comment)
Sorry for keeping you busy with this, I'm just pointing out possibilities of
crash I see in the code though. If you don't want to invest more time on these
then just write the requirements for each parameter in documentation of the
function, and it can be fixed later
Hello Pau Espin Pedrol, Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/3830
to look at the new patch set (#2).
src: _snprintf() helper functions always nul-terminate buffers
This patch inconditionally initializes the buffer we get to
Patch Set 1:
> OK.
>
> So these are the two cases that we could improve:
>
> 1) snprintf() returns -1, very much unlikely in practise.
> 2) msg->len == 0: In such case, I would expect this function is
> never called with an empty message...
>
> Frankly speaking, is there any realistic
Patch Set 1:
> Because I got confused. I remember your original patch is trying to >ensure
> that we leave room for the nul-termination.
If I recall correctly, it does so in case at some point snprintf returns < 0,
in wich case the NUll terminated buffer cannot be ensured.
> Anyway, bottom
Patch Set 1:
(1 comment)
https://gerrit.osmocom.org/#/c/3830/1/src/osmux.c
File src/osmux.c:
Line 941: /* This _snprintf() variant always nul-terminates the buffer. */
> I still don't get why you say at least some variants of snprintf don't cont
Because I got confused. I remember your
Patch Set 1: Code-Review-1
(2 comments)
https://gerrit.osmocom.org/#/c/3830/1/src/osmux.c
File src/osmux.c:
Line 941: /* This _snprintf() variant always nul-terminates the buffer. */
I still don't get why you say at least some variants of snprintf don't contain
nul-terminated buffers.
Review at https://gerrit.osmocom.org/3830
src: _snprintf() helper functions always nul-terminate buffers
Add the \0 for every case, even if this does not match exactly the
snprintf semantics.
Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2
---
M src/osmux.c
M src/rtp.c
2 files changed,