Skip to content

Commit

Permalink
Add error check for blank first/secondArg
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlz committed Apr 20, 2016
1 parent 2d9dbaf commit 88ecd0b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/class-dump.m
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,19 @@ int main(int argc, char *argv[])
terminateWithError(1, "Unrecognized additional argument: %s", argv[optind]);
}
firstArg = [NSString stringWithFileSystemRepresentation:argv[optind]];
if([firstArg length] == 0){
terminateWithError(1, "Arguments can not be blank");
}
}
NSString *secondArg = nil;
if(optind + 1 < argc ){
if(!(shouldTranslateCrashDump | shouldTranslateDsym)){
terminateWithError(1, "Unrecognized additional argument: %s", argv[optind + 1]);
}
secondArg = [NSString stringWithFileSystemRepresentation:argv[optind + 1]];
if([secondArg length] == 0){
terminateWithError(1, "Arguments can not be blank");
}
}
if(argc > optind + 2){
terminateWithError(1, "Unrecognized additional argument: %s", argv[optind + 2]);
Expand Down

0 comments on commit 88ecd0b

Please sign in to comment.