From: graham.gower Date: Sun, 22 Nov 2009 23:15:15 +0000 (+0000) Subject: Add some error checking on fputs. X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d54fe7a27ca63446a689c4020473c47e4bf787fc;p=oweals%2Fopkg-lede.git Add some error checking on fputs. git-svn-id: http://opkg.googlecode.com/svn/trunk@346 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- diff --git a/libopkg/pkg_extract.c b/libopkg/pkg_extract.c index 4257d59..e1b4018 100644 --- a/libopkg/pkg_extract.c +++ b/libopkg/pkg_extract.c @@ -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;