Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/3537/3/src/osmux.c
File src/osmux.c:

Line 918:               SNPRINTF_BUFFER_SIZE(ret, buf_offset, size);
> I'm telling this because I suspect this is papering a problem somewhere els
Are you asking about this exact "No room for OSMUX payload" error case?

It's not about a buffer being full, it's about extra validation to assert we 
don't read out of bounds by checking contents of the packet were not truncated, 
ie. osmux_get_payload_len says there should be 35 bytes, but packet only 
contains 30 bytes more. Thus, we read 4 bytes out of the buffer.

In case you referer to why we may return in the SNPRINTF_BUFFER_SIZE() above:
- In a general case, if the buffer is too small.
- In this specific case (osmux_test calling osmux_snprintf): Initially the 
buffer was 2048, and I changed it to 4096 because I was seeing the buffer 
overflows (initial crash). Then, AMR payload may be a few bytes, but its 
representation using ASCII + spacing + other stuff can grow bigger. Then in one 
osmux frame, you can have 8 of those. And again multiply that by the amount of 
osmux frames in one UDP packet.


-- 
To view, visit https://gerrit.osmocom.org/3537
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7
Gerrit-PatchSet: 3
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Holger Freyther <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Pablo Neira Ayuso <[email protected]>
Gerrit-Reviewer: Pau Espin Pedrol <[email protected]>
Gerrit-HasComments: Yes

Reply via email to