[PATCH][cifs-utils] setcifsacl: fix bad bit-shift in raw_str_to_sid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A Coverity scan turned up this warning:

1. cifs-utils-6.2/setcifsacl.c:578:result_independent_of_operands – "(x & 0xff0000000000ULL) >> 48" is 0 regardless of the values of its operands. This occurs as the operand of assignment.

...which is entirely true. That shift should be 40 bits, not 48.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxx>
---
 setcifsacl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setcifsacl.c b/setcifsacl.c
index ce708eb..7eeeaa6 100644
--- a/setcifsacl.c
+++ b/setcifsacl.c
@@ -575,7 +575,7 @@ raw_str_to_sid(const char *str, struct cifs_sid *csid)
 	csid->authority[3] = (x & 0x000000ff0000ULL) >> 16;
 	csid->authority[2] = (x & 0x0000ff000000ULL) >> 24;
 	csid->authority[1] = (x & 0x00ff00000000ULL) >> 32;
-	csid->authority[0] = (x & 0xff0000000000ULL) >> 48;
+	csid->authority[0] = (x & 0xff0000000000ULL) >> 40;
 
 	/* now read the the subauthorities and store as __le32 vals */
 	p = q + 1;
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux