diff options
author | bfriesen <bfriesen> | 2015-05-30 20:30:27 +0000 |
---|---|---|
committer | bfriesen <bfriesen> | 2015-05-30 20:30:27 +0000 |
commit | 72a80c16e48901a555bb2ea92e7afa616f97a31d (patch) | |
tree | 27cd195315836dd780498e798fe456802adb6851 | |
parent | 5f2152715d580047207050f9818b6e66dc6bb324 (diff) | |
download | libtiff-72a80c16e48901a555bb2ea92e7afa616f97a31d.tar.gz |
* contrib/addtiffo/addtiffo.c (main): Possibly address Coverity
1024226 "Untrusted value as argument".
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | contrib/addtiffo/addtiffo.c | 11 |
2 files changed, 11 insertions, 3 deletions
@@ -1,5 +1,8 @@ 2015-05-30 Bob Friesenhahn <bfriesen@simple.dallas.tx.us> + * contrib/addtiffo/addtiffo.c (main): Possibly address Coverity + 1024226 "Untrusted value as argument". + * tools/gif2tiff.c (readgifimage): Fix Coverity 1024222 "Untrusted value as argument". (checksignature): Fix Coverity 1024894 "Ignoring number of bytes diff --git a/contrib/addtiffo/addtiffo.c b/contrib/addtiffo/addtiffo.c index d3920e26..7bc3f444 100644 --- a/contrib/addtiffo/addtiffo.c +++ b/contrib/addtiffo/addtiffo.c @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: addtiffo.c,v 1.7 2010-06-08 18:55:15 bfriesen Exp $ + * $Id: addtiffo.c,v 1.8 2015-05-30 20:30:27 bfriesen Exp $ * * Project: GeoTIFF Overview Builder * Purpose: Mainline for building overviews in a TIFF file. @@ -28,6 +28,10 @@ ****************************************************************************** * * $Log: addtiffo.c,v $ + * Revision 1.8 2015-05-30 20:30:27 bfriesen + * * contrib/addtiffo/addtiffo.c (main): Possibly address Coverity + * 1024226 "Untrusted value as argument". + * * Revision 1.7 2010-06-08 18:55:15 bfriesen * * contrib: Add an emacs formatting mode footer to all source files * so that emacs can be effectively used. @@ -120,7 +124,8 @@ int main( int argc, char ** argv ) while( nOverviewCount < argc - 2 && nOverviewCount < 100 ) { anOverviews[nOverviewCount] = atoi(argv[nOverviewCount+2]); - if( anOverviews[nOverviewCount] <= 0) + if( (anOverviews[nOverviewCount] <= 0) || + ((anOverviews[nOverviewCount] > 1024))) { fprintf( stderr, "Incorrect parameters\n" ); return(1); @@ -170,7 +175,7 @@ int main( int argc, char ** argv ) /* * Local Variables: * mode: c - * c-basic-offset: 8 + * c-basic-offset: 4 * fill-column: 78 * End: */ |