Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: ui/accessibility/ax_tree_unittest.cc

Issue 2377443002: Fix another bug in AXTree caught by libfuzzer (Closed)
Patch Set: Address feedback Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/accessibility/ax_tree.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/accessibility/ax_tree.h" 5 #include "ui/accessibility/ax_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 AXNodeData node2; 501 AXNodeData node2;
502 node2.id = 0; 502 node2.id = 0;
503 node2.state = 0; 503 node2.state = 0;
504 node2.child_ids.push_back(0); 504 node2.child_ids.push_back(0);
505 node2.child_ids.push_back(0); 505 node2.child_ids.push_back(0);
506 initial_state.nodes.push_back(node2); 506 initial_state.nodes.push_back(node2);
507 ui::AXTree tree; 507 ui::AXTree tree;
508 tree.Unserialize(initial_state); 508 tree.Unserialize(initial_state);
509 } 509 }
510 510
511 // UAF caught by ax_tree_fuzzer
512 TEST(AXTreeTest, BogusAXTree3) {
513 AXTreeUpdate initial_state;
514 AXNodeData node;
515 node.id = 0;
516 node.state = 0;
517 node.child_ids.push_back(1);
518 initial_state.nodes.push_back(node);
519
520 AXNodeData node2;
521 node2.id = 1;
522 node2.state = 0;
523 node2.child_ids.push_back(1);
524 node2.child_ids.push_back(1);
525 initial_state.nodes.push_back(node2);
526
527 ui::AXTree tree;
528 tree.Unserialize(initial_state);
529 }
530
511 } // namespace ui 531 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698