Attention is currently required from: fixeria.
pespin has posted comments on this change. (
https://gerrit.osmocom.org/c/libosmo-netif/+/30837 )
Change subject: osmo-amr-inspect: Improve robustness reading from stdin
......................................................................
Patch Set 1:
(1 comment)
File utils/osmo-amr-inspect.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/30837/comment/caf0a34b_99f714ac
PS1, Line 260: sizeof(buf
Are you sure this is correct? You're asking
osmo_hexparse() to parse the whole buffer (2048 bytes), […]
Yes, that was a bug
before this change too, see API doc:
"""
/*! Parse a string containing hexadecimal digits
* \param[in] str string containing ASCII encoded hexadecimal digits
* \param[out] b output buffer
* \param[in] max_len maximum space in output buffer
* \returns number of parsed octets, or -1 on error
*/
int osmo_hexparse(const char *str, uint8_t *b, unsigned int max_len)
{
...
for (strpos = str; (c = *strpos); strpos++) {
...
}
"""
So hexparse is reading from hex_buf until finding a null character.
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-netif/+/30837
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I460f1deb7455b3b6a85a090bdcad8e21a883db68
Gerrit-Change-Number: 30837
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 04 Jan 2023 18:23:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment