mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-27 07:00:07 +01:00
xdmauth: Correct miscall of abs() to instrad call labs()
xdmauth.c:230:13: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of
type
'int'
which may cause truncation of value [-Wabsolute-value,Semantic Issue]
if (abs(now - client->time) > TwentyFiveMinutes) {
^
xdmauth.c:230:13: note: use function 'labs' instead [Semantic Issue]
if (abs(now - client->time) > TwentyFiveMinutes) {
^~~
labs
xdmauth.c:302:9: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type
'int' which
may cause truncation of value [-Wabsolute-value,Semantic Issue]
if (abs(client->time - now) > TwentyMinutes) {
^
xdmauth.c:302:9: note: use function 'labs' instead [Semantic Issue]
if (abs(client->time - now) > TwentyMinutes) {
^~~
labs
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 85eb90ea45)
This commit is contained in:
parent
0f051cb4c3
commit
a88460ca82
1 changed files with 2 additions and 2 deletions
|
|
@ -227,7 +227,7 @@ XdmClientAuthTimeout(long now)
|
|||
prev = 0;
|
||||
for (client = xdmClients; client; client = next) {
|
||||
next = client->next;
|
||||
if (abs(now - client->time) > TwentyFiveMinutes) {
|
||||
if (labs(now - client->time) > TwentyFiveMinutes) {
|
||||
if (prev)
|
||||
prev->next = next;
|
||||
else
|
||||
|
|
@ -299,7 +299,7 @@ XdmAuthorizationValidate(unsigned char *plain, int length,
|
|||
}
|
||||
now += clockOffset;
|
||||
XdmClientAuthTimeout(now);
|
||||
if (abs(client->time - now) > TwentyMinutes) {
|
||||
if (labs(client->time - now) > TwentyMinutes) {
|
||||
free(client);
|
||||
if (reason)
|
||||
*reason = "Excessive XDM-AUTHORIZATION-1 time offset";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue