Attention is currently required from: pespin.
6 comments:
Patchset:
the function was defined to return null for short buf.
The new version is better, it returns a truncated string and the would-be-required length.
File src/socket.c:
Patch Set #1, Line 1827: /*! string-format a given osmo_sockaddr address into a user-supplied buffer.
I think you are changing how this function used to worked here, and imho it's unexpected. […]
Previously, the function would return NULL in case of errors, just in a specific corner case it didn't. Read the API doc: "or NULL if too short". The C test shows this.
File tests/socket/socket_test.c:
Patch Set #2, Line 350: OSMO_ASSERT(!strncmp("[::1]:4", result, sizeof(buf)));
here for some reason, even though the port number should be 42, the function failed to return NULL.
Patch Set #2, Line 350: OSMO_ASSERT(result == NULL);
Now this corner case is fixed.
Patch Set #2, Line 357: OSMO_ASSERT(result == NULL);
here and
Patch Set #2, Line 363: OSMO_ASSERT(result == NULL);
here it was always verified to return NULL for a short buffer
To view, visit change 26608. To unsubscribe, or for help writing mail filters, visit settings.