Skip to content

Commit d607541

Browse files
author
Mina Farid
authored
Fuzz test internal method in FIRFieldPath (#1675)
1 parent 15ef78f commit d607541

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Firestore/Example/FuzzTests/FuzzingTargets/FSTFuzzTestFieldPath.mm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#import "Firestore/Example/FuzzTests/FuzzingTargets/FSTFuzzTestFieldPath.h"
2222

23-
#import "Firestore/Source/Public/FIRFieldPath.h"
23+
#import "Firestore/Source/API/FIRFieldPath+Internal.h"
2424

2525
namespace firebase {
2626
namespace firestore {
@@ -32,6 +32,13 @@ int FuzzTestFieldPath(const uint8_t *data, size_t size) {
3232
NSData *d = [NSData dataWithBytes:data length:size];
3333
NSString *str = [[NSString alloc] initWithData:d encoding:NSUTF8StringEncoding];
3434

35+
// Create a FieldPath object from a string.
36+
@try {
37+
[FIRFieldPath pathWithDotSeparatedString:str];
38+
} @catch (...) {
39+
// Ignore caught exceptions.
40+
}
41+
3542
// Fuzz test creating a FieldPath from an array with a single string.
3643
NSArray *str_arr1 = [NSArray arrayWithObjects:str, nil];
3744
@try {

0 commit comments

Comments
 (0)