mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr.git
synced 2025-10-26 09:43:46 +00:00
Compare commits
1 Commits
osmith/aut
...
neels/gsup
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1b9e0246e |
@@ -40,8 +40,14 @@ struct osmo_gsup_conn *gsup_route_find(struct osmo_gsup_server *gs,
|
||||
struct gsup_route *gr;
|
||||
|
||||
llist_for_each_entry(gr, &gs->routes, list) {
|
||||
if (talloc_total_size(gr->addr) == addrlen &&
|
||||
!memcmp(gr->addr, addr, addrlen))
|
||||
size_t gr_addrlen = talloc_total_size(gr->addr); /* gr->addr is a nul-terminated string */
|
||||
|
||||
/* FIXME: despite passing addrlen, a lot of code assumes that addr is also nul-terminated */
|
||||
if (gr_addrlen == addrlen && !memcmp(gr->addr, addr, addrlen))
|
||||
return gr->conn;
|
||||
|
||||
/* Compare addr as non-nul-terminated blob */
|
||||
if (gr_addrlen - 1 == addrlen && !memcmp(gr->addr, addr, addrlen))
|
||||
return gr->conn;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user