sd-bus: avoid magic number in SASL length calculation
Lets avoid magic numbers and use a constant `strlen()` instead. Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
This commit is contained in:
parent
94dfd646b3
commit
3cacdab925
|
@ -386,7 +386,9 @@ static int bus_socket_auth_verify_server(sd_bus *b) {
|
|||
|
||||
if (line_begins(line, l, "AUTH ANONYMOUS")) {
|
||||
|
||||
r = verify_anonymous_token(b, line + 14, l - 14);
|
||||
r = verify_anonymous_token(b,
|
||||
line + strlen("AUTH ANONYMOUS"),
|
||||
l - strlen("AUTH ANONYMOUS"));
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
|
@ -398,7 +400,9 @@ static int bus_socket_auth_verify_server(sd_bus *b) {
|
|||
|
||||
} else if (line_begins(line, l, "AUTH EXTERNAL")) {
|
||||
|
||||
r = verify_external_token(b, line + 13, l - 13);
|
||||
r = verify_external_token(b,
|
||||
line + strlen("AUTH EXTERNAL"),
|
||||
l - strlen("AUTH EXTERNAL"));
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
|
|
Loading…
Reference in a new issue