Bug 12650 - source4/heimdal/lib/krb5/ticket.c
source4/heimdal/lib/krb5/ticket.c
Status: RESOLVED WORKSFORME
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build
4.6.0
x64 Mac OS X
: P5 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-11 17:30 UTC by Ruga
Modified: 2017-03-12 18:17 UTC (History)
0 users

See Also:


Attachments
patch (605 bytes, patch)
2017-03-11 17:32 UTC, Ruga
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ruga 2017-03-11 17:30:47 UTC
../source4/heimdal/lib/krb5/ticket.c:707:5: 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]
        && abs(tmp_time - sec_now) > context->max_skew) {
           ^

../source4/heimdal/lib/krb5/ticket.c:711:11: 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]
                               abs(tmp_time - sec_now),
                               ^
Comment 1 Ruga 2017-03-11 17:32:20 UTC
Created attachment 13042 [details]
patch
Comment 2 Ruga 2017-03-12 18:17:30 UTC
Comment on attachment 13042 [details]
patch

>--- source4/heimdal/lib/krb5/ticket.c.orig	2017-03-11 18:28:23.000000000 +0100
>+++ source4/heimdal/lib/krb5/ticket.c	2017-03-11 18:31:20.000000000 +0100
>@@ -704,11 +704,11 @@
> 	tmp_time = rep->enc_part.authtime;
> 
>     if (creds->times.starttime == 0
>-	&& abs(tmp_time - sec_now) > context->max_skew) {
>+	&& labs(tmp_time - sec_now) > context->max_skew) {
> 	ret = KRB5KRB_AP_ERR_SKEW;
> 	krb5_set_error_message (context, ret,
> 				N_("time skew (%d) larger than max (%d)", ""),
>-			       abs(tmp_time - sec_now),
>+			       labs(tmp_time - sec_now),
> 			       (int)context->max_skew);
> 	goto out;
>     }