File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1534,6 +1534,10 @@ struct lease_ctx_info *parse_lease_state(void *open_req, bool is_dir)
1534
1534
if (sizeof (struct lease_context_v2 ) == le32_to_cpu (cc -> DataLength )) {
1535
1535
struct create_lease_v2 * lc = (struct create_lease_v2 * )cc ;
1536
1536
1537
+ if (le16_to_cpu (cc -> DataOffset ) + le32_to_cpu (cc -> DataLength ) <
1538
+ sizeof (struct create_lease_v2 ) - 4 )
1539
+ return NULL ;
1540
+
1537
1541
memcpy (lreq -> lease_key , lc -> lcontext .LeaseKey , SMB2_LEASE_KEY_SIZE );
1538
1542
if (is_dir ) {
1539
1543
lreq -> req_state = lc -> lcontext .LeaseState &
@@ -1551,6 +1555,10 @@ struct lease_ctx_info *parse_lease_state(void *open_req, bool is_dir)
1551
1555
} else {
1552
1556
struct create_lease * lc = (struct create_lease * )cc ;
1553
1557
1558
+ if (le16_to_cpu (cc -> DataOffset ) + le32_to_cpu (cc -> DataLength ) <
1559
+ sizeof (struct create_lease ))
1560
+ return NULL ;
1561
+
1554
1562
memcpy (lreq -> lease_key , lc -> lcontext .LeaseKey , SMB2_LEASE_KEY_SIZE );
1555
1563
lreq -> req_state = lc -> lcontext .LeaseState ;
1556
1564
lreq -> flags = lc -> lcontext .LeaseFlags ;
You can’t perform that action at this time.
0 commit comments