OLD | NEW |
1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 STANDARD_RIGHTS_READ | STANDARD_RIGHTS_WRITE, | 616 STANDARD_RIGHTS_READ | STANDARD_RIGHTS_WRITE, |
617 handle.granted_access & STANDARD_RIGHTS_ALL); | 617 handle.granted_access & STANDARD_RIGHTS_ALL); |
618 EXPECT_EQ(0, handle.attributes); | 618 EXPECT_EQ(0, handle.attributes); |
619 } | 619 } |
620 } | 620 } |
621 EXPECT_TRUE(found_file_handle); | 621 EXPECT_TRUE(found_file_handle); |
622 EXPECT_TRUE(found_key_handle); | 622 EXPECT_TRUE(found_key_handle); |
623 EXPECT_TRUE(found_mapping_handle); | 623 EXPECT_TRUE(found_mapping_handle); |
624 } | 624 } |
625 | 625 |
| 626 TEST(ProcessInfo, OutOfRangeCheck) { |
| 627 const size_t kAllocationSize = 12345; |
| 628 scoped_ptr<char[]> safe_memory(new char[kAllocationSize]); |
| 629 |
| 630 ProcessInfo info; |
| 631 info.Initialize(GetCurrentProcess()); |
| 632 |
| 633 EXPECT_TRUE( |
| 634 info.LoggingRangeIsFullyReadable(CheckedRange<WinVMAddress, WinVMSize>( |
| 635 reinterpret_cast<WinVMAddress>(safe_memory.get()), kAllocationSize))); |
| 636 EXPECT_FALSE(info.LoggingRangeIsFullyReadable( |
| 637 CheckedRange<WinVMAddress, WinVMSize>(0, 1024))); |
| 638 } |
| 639 |
626 } // namespace | 640 } // namespace |
627 } // namespace test | 641 } // namespace test |
628 } // namespace crashpad | 642 } // namespace crashpad |
OLD | NEW |