commit 09db83809a60a3999b733129061b69882ec86f59
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Apr 12 18:34:26 2014 +0200

    error-check reading of old uidvalidity and maxuid files
    
    found by coverity.

 src/compat/convert.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/compat/convert.c b/src/compat/convert.c
index 19209aa..921335c 100644
--- a/src/compat/convert.c
+++ b/src/compat/convert.c
@@ -128,13 +128,21 @@ convert( config_t *box )
                sys_error( "Cannot open %s", iuvname );
                goto err2;
        }
-       fscanf( fp, "%d", &uidval );
+       if (fscanf( fp, "%d", &uidval ) != 1) {
+               sys_error( "Cannot read %s", iuvname );
+         err3:
+               fclose( fp );
+               goto err2;
+       }
        fclose( fp );
        if (!(fp = fopen( imuname, "r" ))) {
                sys_error( "Cannot open %s", imuname );
                goto err2;
        }
-       fscanf( fp, "%d", &maxuid );
+       if (fscanf( fp, "%d", &maxuid ) != 1) {
+               sys_error( "Cannot read %s", imuname );
+               goto err3;
+       }
        fclose( fp );
 
        if (!stat( iumname, &sb )) {

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to