Add some error checking on fputs.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Sun, 22 Nov 2009 23:15:15 +0000 (23:15 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Sun, 22 Nov 2009 23:15:15 +0000 (23:15 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@346 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/pkg_extract.c

index 4257d59806e433014c2be529a995556ae03c33d9..e1b4018bfa400a30488e23b679a46260af65a6b0 100644 (file)
@@ -37,7 +37,11 @@ int pkg_extract_control_file_to_stream(pkg_t *pkg, FILE *stream)
        return EINVAL;
     }
 
-    fputs(buffer, stream);
+    if (fputs(buffer, stream) == EOF) {
+       free(buffer);
+       return EINVAL;
+    }
+
     free(buffer);
 
     return 0;