aboutsummaryrefslogtreecommitdiffstats
path: root/main/oscam/fclose.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-09-29 15:54:12 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-09-29 15:55:10 +0200
commit48cf8ee4d00068967848c3c9deb33b6c996c1697 (patch)
treeb03ab4033e600781d81ccb4cd58e76b4c5e23f07 /main/oscam/fclose.patch
parent97f57dcaeb821475a6ea29a9c805df706f015225 (diff)
downloadaports-48cf8ee4d00068967848c3c9deb33b6c996c1697.tar.bz2
aports-48cf8ee4d00068967848c3c9deb33b6c996c1697.tar.xz
main/oscam: fix segfault due to fclose(0)
http://www.streamboard.tv/oscam/changeset/11019/
Diffstat (limited to 'main/oscam/fclose.patch')
-rw-r--r--main/oscam/fclose.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/main/oscam/fclose.patch b/main/oscam/fclose.patch
new file mode 100644
index 0000000000..145c35d312
--- /dev/null
+++ b/main/oscam/fclose.patch
@@ -0,0 +1,29 @@
+Index: /trunk/oscam-conf.c
+===================================================================
+--- trunk/oscam-conf.c (revision 11018)
++++ trunk/oscam-conf.c (revision 11019)
+@@ -525,5 +525,8 @@
+ strncat(tmp_file, ".tmp", sizeof(tmp_file) - strlen(tmp_file) - 1);
+ strncat(bak_file, ".bak", sizeof(bak_file) - strlen(bak_file) - 1);
+- fclose(f);
++ if(f)
++ {
++ fclose(f);
++ }
+ return safe_overwrite_with_bak(dst_file, tmp_file, bak_file, cfg.http_overwrite_bak_file);
+ }
+Index: /trunk/oscam-config.c
+===================================================================
+--- trunk/oscam-config.c (revision 11018)
++++ trunk/oscam-config.c (revision 11019)
+@@ -436,5 +436,9 @@
+ {
+ fp = create_config_file("oscam.srvid2");
+- flush_config_file(fp, "oscam.srvid2");
++ if(fp)
++ {
++ flush_config_file(fp, "oscam.srvid2");
++ }
++
+ return 0;
+ }