fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16202 )

Change subject: add libosmo-mslookup abstract client
......................................................................


Patch Set 20: Code-Review+1

(3 comments)

Feel free to merge, I do not want to block the whole patch set.

https://gerrit.osmocom.org/c/osmo-hlr/+/16202/15/src/mslookup/mslookup.c
File src/mslookup/mslookup.c:

https://gerrit.osmocom.org/c/osmo-hlr/+/16202/15/src/mslookup/mslookup.c@128 
PS15, Line 128: strncmp(a->msisdn, b->msisdn, sizeof(a->msisdn));
> note that the n is sizeof(), i.e. the maximum buffer size, and not the 
> strlen(). […]
Oh, I overlooked it. Fine by me.


https://gerrit.osmocom.org/c/osmo-hlr/+/16202/15/src/mslookup/mslookup.c@130
PS15, Line 130: return 0;
> we don't know where the id came from, maybe it is random data incoming from 
> the internet. [...]

Ok, but shouldn't we sanitize/check the received data before passing to this 
function? If not an assert(), then at least a warning should be here. Or at 
least a different return value. Not a merge blocker though.


https://gerrit.osmocom.org/c/osmo-hlr/+/16202/15/src/mslookup/mslookup_client.c
File src/mslookup/mslookup_client.c:

https://gerrit.osmocom.org/c/osmo-hlr/+/16202/15/src/mslookup/mslookup_client.c@59
PS15, Line 59: talloc_zero
> I use talloc_zero() by principle, and in my coding style I often fully 
> initialize all members shortl […]
Well, there is a bad side of zero-initialization: it's harder to see/find bugs. 
Neither ASAN nor Valgrind would show you that you're using a non-initialized 
value. That's e.g. why libosmovty could write to stdin/fd=0 (!), because 
somebody forgot to initialize it properly.



--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16202
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I83487ab8aad1611eb02e997dafbcb8344da13df1
Gerrit-Change-Number: 16202
Gerrit-PatchSet: 20
Gerrit-Owner: neels <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-Comment-Date: Thu, 09 Jan 2020 17:58:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: fixeria <[email protected]>
Comment-In-Reply-To: neels <[email protected]>
Gerrit-MessageType: comment

Reply via email to