1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-24 22:22:08 +03:00

Avoid a segfault when calling src-verify without any arguments.

FossilOrigin-Name: c0c4e6f111b9b16538aad33e83f02f8d7835e952649f5cee610c068722bea4a4
This commit is contained in:
stephan
2024-10-11 19:22:32 +00:00
parent c85c102efe
commit ea7ea76a59
3 changed files with 11 additions and 7 deletions

View File

@ -854,12 +854,16 @@ int main(int argc, char **argv){
xErr = errorMsgNH;
continue;
}
usage:
fprintf(stderr, "Usage: %s DIRECTORY\n"
" or: %s --sha1 FILE ...\n"
" or: %s --sha3 FILE ...\n",
argv[0], argv[0], argv[0]);
return 1;
}
if( !zDir ){
goto usage;
}
if( strlen(zDir)>1000 ){
fprintf(stderr, "Directory argument too big: [%s]\n", zDir);
return 1;