Commit 2b221734 authored by Bob Friesenhahn's avatar Bob Friesenhahn

* contrib/addtiffo/addtiffo.c (main): Possibly address Coverity

1024226 "Untrusted value as argument".
parent 478e5112
2015-05-30 Bob Friesenhahn <[email protected]>
* 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
......
/******************************************************************************
* $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:
*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment