Hi! On Tue, 2024-11-26 at 17:13:29 +0100, Guillem Jover wrote: > Package: ffproxy > Version: 1.6-12.1 > Severity: serious > Tags: patch > X-Debbugs-Cc: Chris Hofstaedtler <z...@debian.org> > > We just noticed segfaults while running ffproxy on our lab systems, > when we have DNS resolve issues (say a bogus entry from > /etc/resolv.conf). While debugging this I realized the original fix > for the type change was wrong, so my fix was subsequently also wrong. > The attached patch against the unpacked source should fix the type > mismatch and fixes the segfaults for us.
I was thinking the other day, that the problem this happened in the first place was because the header declaring the structs was not being included by the files defining them. So I've refreshed the patch to fix that to avoid any similar situation in the future from happening for these variables. Thanks, Guillem
diff --git i/debian/patches/08_fix_variables_declaration_conflicts w/debian/patches/08_fix_variables_declaration_conflicts index c179c56..1efce9e 100644 --- i/debian/patches/08_fix_variables_declaration_conflicts +++ w/debian/patches/08_fix_variables_declaration_conflicts @@ -1,13 +1,21 @@ Description: Fix conflicting declarations of some variables -Author: Emmanuel Bouthenot <kol...@debian.org> +Author: Guillem Jover <gjo...@sipwise.com> Bug-Debian: https://bugs.debian.org/688462 +Bug-Debian: https://bugs.debian.org/1074954 +Origin: vendor Forwarded: no -Last-Update: 2019-02-18 +Last-Update: 2024-12-12 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- + db.c | 1 + + dbs.h | 12 ++++++------ + msg.c | 10 +++++----- + 3 files changed, 12 insertions(+), 11 deletions(-) + --- a/dbs.h +++ b/dbs.h -@@ -12,9 +12,9 @@ +@@ -12,9 +12,9 @@ extern char *f_hdr_add[]; extern regex_t *f_rhdr_drop[]; extern regex_t *f_rhdr_match[]; extern char *f_rhdr_entry[]; @@ -17,9 +25,46 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ -extern char *e_post; -extern char *e_fil; -extern char *e_nic; -+extern struct msg *e_inv; -+extern struct msg *e_res; -+extern struct msg *e_con; -+extern struct msg *e_post; -+extern struct msg *e_fil; -+extern struct msg *e_nic; ++extern struct msg e_inv; ++extern struct msg e_res; ++extern struct msg e_con; ++extern struct msg e_post; ++extern struct msg e_fil; ++extern struct msg e_nic; +--- a/msg.c ++++ b/msg.c +@@ -46,19 +46,19 @@ err_msg(int s, struct req * r, int m) + + switch (m) { + case E_INV: +- p = e_inv; ++ p = e_inv.c; + break; + case E_RES: +- p = e_res; ++ p = e_res.c; + break; + case E_CON: +- p = e_con; ++ p = e_con.c; + break; + case E_POST: +- p = e_post; ++ p = e_post.c; + break; + case E_FIL: +- p = e_fil; ++ p = e_fil.c; + break; + } + +--- a/db.c ++++ b/db.c +@@ -39,6 +39,7 @@ + #include "cfg.h" + #include "print.h" + #include "msg.h" ++#include "dbs.h" + #include "alloc.h" + #include "file.h" + #include "db.h" diff --git i/debian/patches/fix-incompat-ptr-types.patch w/debian/patches/fix-incompat-ptr-types.patch deleted file mode 100644 index 42f3f48..0000000 --- i/debian/patches/fix-incompat-ptr-types.patch +++ /dev/null @@ -1,40 +0,0 @@ -Author: Guillem Jover <gjo...@sipwise.com> -Description: Fix incompatible pointer type asssignment - We cannot assign a struct into a char *, even if the first member is a char *. - Instead assign that member into the variable. -Origin: vendor -Bug-Debian: https://bugs.debian.org/1074954 -Forwarded: no -Last-Update: 2024-09-16 - ---- - msg.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - ---- a/msg.c -+++ b/msg.c -@@ -46,19 +46,19 @@ err_msg(int s, struct req * r, int m) - - switch (m) { - case E_INV: -- p = e_inv; -+ p = e_inv->c; - break; - case E_RES: -- p = e_res; -+ p = e_res->c; - break; - case E_CON: -- p = e_con; -+ p = e_con->c; - break; - case E_POST: -- p = e_post; -+ p = e_post->c; - break; - case E_FIL: -- p = e_fil; -+ p = e_fil->c; - break; - } - diff --git i/debian/patches/series w/debian/patches/series index 983d3b6..1da3530 100644 --- i/debian/patches/series +++ w/debian/patches/series @@ -7,4 +7,3 @@ 06_handle-multibytes-headers 07_fix_segfault_syslog_logrequests 08_fix_variables_declaration_conflicts -fix-incompat-ptr-types.patch