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 @@ -1505,6 +1505,10 @@ struct lease_ctx_info *parse_lease_state(void *open_req)
1505
1505
if (sizeof (struct lease_context_v2 ) == le32_to_cpu (cc -> DataLength )) {
1506
1506
struct create_lease_v2 * lc = (struct create_lease_v2 * )cc ;
1507
1507
1508
+ if (le16_to_cpu (cc -> DataOffset ) + le32_to_cpu (cc -> DataLength ) <
1509
+ sizeof (struct create_lease_v2 ) - 4 )
1510
+ return NULL ;
1511
+
1508
1512
memcpy (lreq -> lease_key , lc -> lcontext .LeaseKey , SMB2_LEASE_KEY_SIZE );
1509
1513
lreq -> req_state = lc -> lcontext .LeaseState ;
1510
1514
lreq -> flags = lc -> lcontext .LeaseFlags ;
@@ -1517,6 +1521,10 @@ struct lease_ctx_info *parse_lease_state(void *open_req)
1517
1521
} else {
1518
1522
struct create_lease * lc = (struct create_lease * )cc ;
1519
1523
1524
+ if (le16_to_cpu (cc -> DataOffset ) + le32_to_cpu (cc -> DataLength ) <
1525
+ sizeof (struct create_lease ))
1526
+ return NULL ;
1527
+
1520
1528
memcpy (lreq -> lease_key , lc -> lcontext .LeaseKey , SMB2_LEASE_KEY_SIZE );
1521
1529
lreq -> req_state = lc -> lcontext .LeaseState ;
1522
1530
lreq -> flags = lc -> lcontext .LeaseFlags ;
You can’t perform that action at this time.
0 commit comments