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.