s3-dcerpc: fix build warning seen with -O3.
authorGünther Deschner <gd@samba.org>
Fri, 13 Aug 2010 13:12:29 +0000 (15:12 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 13 Aug 2010 13:20:58 +0000 (15:20 +0200)
"warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false"

Guenther

source3/librpc/rpc/dcerpc_helpers.c

index 84f7ce4c8262ce24a0e72beba61d7f7e4a46afbb..f8ca8e62762cfb02de4e1147420e782c26c75264 100644 (file)
@@ -898,9 +898,9 @@ NTSTATUS dcerpc_check_auth(struct pipe_auth_data *auth,
        if (pkt->auth_length > pkt->frag_length) {
                return NT_STATUS_INFO_LENGTH_MISMATCH;
        }
-       if ((pkt->auth_length
-            + DCERPC_AUTH_TRAILER_LENGTH < pkt->auth_length) ||
-           (pkt->auth_length
+       if (((unsigned int)pkt->auth_length
+            + DCERPC_AUTH_TRAILER_LENGTH < (unsigned int)pkt->auth_length) ||
+           ((unsigned int)pkt->auth_length
             + DCERPC_AUTH_TRAILER_LENGTH < DCERPC_AUTH_TRAILER_LENGTH)) {
                /* Integer wrap attempt. */
                return NT_STATUS_INFO_LENGTH_MISMATCH;