2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-03 07:12:28 +00:00

don't overrun argv with invalid arguments

git-svn-id: svn+q:///qpdf/trunk@1043 71b93d88-0707-0410-a8cf-f5a4172ac649
This commit is contained in:
Jay Berkenbilt 2010-10-04 15:16:32 +00:00
parent 31e8d6d565
commit bcb10021d7

View File

@ -17,9 +17,9 @@ static void usage()
int main(int argc, char* argv[])
{
char* infile = argv[1];
char* password = argv[2];
char* outfile = argv[3];
char* infile = NULL;
char* password = NULL;
char* outfile = NULL;
qpdf_data qpdf = qpdf_init();
int warnings = 0;
int errors = 0;
@ -43,6 +43,10 @@ int main(int argc, char* argv[])
usage();
}
infile = argv[1];
password = argv[2];
outfile = argv[3];
if (((qpdf_read(qpdf, infile, password) & QPDF_ERRORS) == 0) &&
((qpdf_init_write(qpdf, outfile) & QPDF_ERRORS) == 0))
{