From d54fe7a27ca63446a689c4020473c47e4bf787fc Mon Sep 17 00:00:00 2001 From: "graham.gower" Date: Sun, 22 Nov 2009 23:15:15 +0000 Subject: [PATCH] Add some error checking on fputs. git-svn-id: http://opkg.googlecode.com/svn/trunk@346 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- libopkg/pkg_extract.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.25.1