diff -Nru v4l-utils-1.14.2/debian/changelog v4l-utils-1.14.2/debian/changelog --- v4l-utils-1.14.2/debian/changelog 2018-02-10 13:46:51.000000000 +0100 +++ v4l-utils-1.14.2/debian/changelog 2019-04-14 13:36:07.000000000 +0200 @@ -1,3 +1,10 @@ +v4l-utils (1.14.2-1ubuntu1) cosmic; urgency=medium + + * Fix FTBFS due to missing libc includes. LP: #1823650 + * Fix double-free, and uninitailized memory issue. LP: #1819650 + + -- Gregor Jasny Sun, 14 Apr 2019 13:36:07 +0200 + v4l-utils (1.14.2-1) unstable; urgency=medium * Imported Upstream version 1.14.2 diff -Nru v4l-utils-1.14.2/debian/gbp.conf v4l-utils-1.14.2/debian/gbp.conf --- v4l-utils-1.14.2/debian/gbp.conf 2018-02-10 13:36:39.000000000 +0100 +++ v4l-utils-1.14.2/debian/gbp.conf 2019-04-08 20:15:55.000000000 +0200 @@ -1,7 +1,7 @@ [DEFAULT] upstream-branch = upstream -debian-branch = master +debian-branch = cosmic upstream-tag = upstream/%(version)s -debian-tag = debian/%(version)s +debian-tag = ubuntu/%(version)s pristine-tar = True compression = bzip2 diff -Nru v4l-utils-1.14.2/debian/patches/0001-libv4lconvert-fix-compiler-warning.patch v4l-utils-1.14.2/debian/patches/0001-libv4lconvert-fix-compiler-warning.patch --- v4l-utils-1.14.2/debian/patches/0001-libv4lconvert-fix-compiler-warning.patch 1970-01-01 01:00:00.000000000 +0100 +++ v4l-utils-1.14.2/debian/patches/0001-libv4lconvert-fix-compiler-warning.patch 2019-04-14 13:17:57.000000000 +0200 @@ -0,0 +1,37 @@ +Subject: libv4lconvert: fix compiler warning +Author: Hans Verkuil +Origin: upstream, https://git.linuxtv.org/v4l-utils.git/commit/?h=stable-1.14&id=b6c3e824967e25857a41e1c0e23d010317566467 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/v4l-utils/+bug/1823650 + + CC control/libv4lconvert_la-libv4lcontrol.lo +control/libv4lcontrol.c: In function ‘v4lcontrol_get_usb_info’: +control/libv4lcontrol.c:391:13: warning: In the GNU C Library, "minor" is defined + by . For historical compatibility, it is + currently defined by as well, but we plan to + remove this soon. To use "minor", include + directly. If you did not intend to use a system-defined macro + "minor", you should undefine it after including . + c == '\n' && minor_dev == minor(st.st_rdev)) + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Dropped the '#if defined(MAJOR_IN_SYSMACROS)' to ensure that sysmacros.h +is always included. It seems that #if is no longer needed. At least, +nobody complained when I removed it in other places earlier :-) + +Signed-off-by: Hans Verkuil +--- + lib/libv4lconvert/control/libv4lcontrol.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/lib/libv4lconvert/control/libv4lcontrol.c ++++ b/lib/libv4lconvert/control/libv4lcontrol.c +@@ -20,9 +20,7 @@ + */ + + #include +-#if defined(MAJOR_IN_SYSMACROS) + #include +-#endif + #include + #include + #include diff -Nru v4l-utils-1.14.2/debian/patches/0002-include-sys-sysmacros.h-for-major-minor.patch v4l-utils-1.14.2/debian/patches/0002-include-sys-sysmacros.h-for-major-minor.patch --- v4l-utils-1.14.2/debian/patches/0002-include-sys-sysmacros.h-for-major-minor.patch 1970-01-01 01:00:00.000000000 +0100 +++ v4l-utils-1.14.2/debian/patches/0002-include-sys-sysmacros.h-for-major-minor.patch 2019-04-14 13:18:52.000000000 +0200 @@ -0,0 +1,27 @@ +Subject: include sys/sysmacros.h for major() & minor() +Author: Mike Frysinger +Origin: upstream, https://git.linuxtv.org/v4l-utils.git/commit/?h=stable-1.14&id=65b6f255a02de403621e478aac701e3ee56806a4 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/v4l-utils/+bug/1823650 + +Linux C libraries are looking to disentangle sysmacros.h from the +sys/types.h header to clean up namespace pollution. Since these +macros are provided in glibc/etc... today, switch to pulling in +this header directly. + +Signed-off-by: Mike Frysinger +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +--- + utils/v4l2-ctl/v4l2-ctl.cpp | 1 + + 1 file changed, 1 insertion(+) + +--- a/utils/v4l2-ctl/v4l2-ctl.cpp ++++ b/utils/v4l2-ctl/v4l2-ctl.cpp +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff -Nru v4l-utils-1.14.2/debian/patches/0003-dvbv5-tools-be-sure-to-zero-struct-arguments.patch v4l-utils-1.14.2/debian/patches/0003-dvbv5-tools-be-sure-to-zero-struct-arguments.patch --- v4l-utils-1.14.2/debian/patches/0003-dvbv5-tools-be-sure-to-zero-struct-arguments.patch 1970-01-01 01:00:00.000000000 +0100 +++ v4l-utils-1.14.2/debian/patches/0003-dvbv5-tools-be-sure-to-zero-struct-arguments.patch 2019-04-14 13:24:00.000000000 +0200 @@ -0,0 +1,50 @@ +Subject: dvbv5-tools: be sure to zero struct arguments +Author: Mauro Carvalho Chehab +Origin: upstream, https://git.linuxtv.org/v4l-utils.git/commit/?h=stable-1.14&id=23e5056b0487acdaa56e5569952b5a8f344cf49b +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1819650 + +From 23e5056b0487acdaa56e5569952b5a8f344cf49b Mon Sep 17 00:00:00 2001 +Date: Thu, 14 Mar 2019 19:23:38 -0300 + +Let's not let the arguments struct with some random value. + +Signed-off-by: Mauro Carvalho Chehab +--- + utils/dvb/dvb-format-convert.c | 2 +- + utils/dvb/dvbv5-scan.c | 2 +- + utils/dvb/dvbv5-zap.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +--- a/utils/dvb/dvb-format-convert.c ++++ b/utils/dvb/dvb-format-convert.c +@@ -123,7 +123,7 @@ + + int main(int argc, char **argv) + { +- struct arguments args; ++ struct arguments args = {}; + int idx = -1, missing = 0; + const struct argp argp = { + .options = options, +--- a/utils/dvb/dvbv5-scan.c ++++ b/utils/dvb/dvbv5-scan.c +@@ -450,7 +450,7 @@ + + int main(int argc, char **argv) + { +- struct arguments args; ++ struct arguments args = {}; + int err, lnb = -1,idx = -1; + struct dvb_device *dvb; + struct dvb_dev_list *dvb_dev; +--- a/utils/dvb/dvbv5-zap.c ++++ b/utils/dvb/dvbv5-zap.c +@@ -805,7 +805,7 @@ + + int main(int argc, char **argv) + { +- struct arguments args; ++ struct arguments args = {}; + char *homedir = getenv("HOME"); + char *channel = NULL; + int lnb = -1, idx = -1; diff -Nru v4l-utils-1.14.2/debian/patches/0005-libdvbv5-leaks-and-double-free-in-dvb_fe_open_fname.patch v4l-utils-1.14.2/debian/patches/0005-libdvbv5-leaks-and-double-free-in-dvb_fe_open_fname.patch --- v4l-utils-1.14.2/debian/patches/0005-libdvbv5-leaks-and-double-free-in-dvb_fe_open_fname.patch 1970-01-01 01:00:00.000000000 +0100 +++ v4l-utils-1.14.2/debian/patches/0005-libdvbv5-leaks-and-double-free-in-dvb_fe_open_fname.patch 2019-04-14 13:23:58.000000000 +0200 @@ -0,0 +1,93 @@ +Subject: libdvbv5: leaks and double free in dvb_fe_open_fname() +Author: Sean Young +Origin: upstream, https://git.linuxtv.org/v4l-utils.git/commit/?h=stable-1.14&id=4b3fd7860ca495ff4a27245a580769acc899f52c +Bug-Ubuntu: https://bugs.launchpad.net/raspbian/+bug/1819650 + +dvb_fe_open_fname() takes ownership of fname if the function succeeds, but +also in two of the error paths (e.g. if the ioctl FE_GET_PROPERTY fails). + +Adjust dvb_fe_open_fname() so it copies fname rather than taking ownership +(and passing that to params). This makes the code cleaner. + +Signed-off-by: Sean Young +--- + lib/libdvbv5/dvb-dev-local.c | 2 +- + lib/libdvbv5/dvb-fe.c | 18 ++++++++---------- + 2 files changed, 9 insertions(+), 11 deletions(-) + +--- a/lib/libdvbv5/dvb-dev-local.c ++++ b/lib/libdvbv5/dvb-dev-local.c +@@ -457,7 +457,7 @@ + flags &= ~O_NONBLOCK; + } + +- ret = dvb_fe_open_fname(parms, strdup(dev->path), flags); ++ ret = dvb_fe_open_fname(parms, dev->path, flags); + if (ret) { + free(open_dev); + return NULL; +--- a/lib/libdvbv5/dvb-fe.c ++++ b/lib/libdvbv5/dvb-fe.c +@@ -133,7 +133,6 @@ + int flags) + { + int ret; +- char *fname; + struct dvb_device *dvb; + struct dvb_dev_list *dvb_dev; + struct dvb_v5_fe_parms_priv *parms = NULL; +@@ -153,7 +152,6 @@ + dvb_dev_free(dvb); + return NULL; + } +- fname = strdup(dvb_dev->path); + + if (!strcmp(dvb_dev->bus_addr, "platform:dvbloopback")) { + logfunc(LOG_WARNING, _("Detected dvbloopback")); +@@ -161,14 +159,10 @@ + } + + dvb_dev_free(dvb); +- if (!fname) { +- logfunc(LOG_ERR, _("fname calloc: %s"), strerror(errno)); +- return NULL; +- } ++ + parms = calloc(sizeof(*parms), 1); + if (!parms) { + logfunc(LOG_ERR, _("parms calloc: %s"), strerror(errno)); +- free(fname); + return NULL; + } + parms->p.verbose = verbose; +@@ -183,7 +177,7 @@ + if (use_legacy_call) + parms->p.legacy_fe = 1; + +- ret = dvb_fe_open_fname(parms, fname, flags); ++ ret = dvb_fe_open_fname(parms, dvb_dev->path, flags); + if (ret < 0) { + free(parms); + return NULL; +@@ -201,7 +195,6 @@ + fd = open(fname, flags, 0); + if (fd == -1) { + dvb_logerr(_("%s while opening %s"), strerror(errno), fname); +- free(fname); + return -errno; + } + +@@ -224,7 +217,12 @@ + } + } + +- parms->fname = fname; ++ parms->fname = strdup(fname); ++ if (!parms->fname) { ++ dvb_logerr(_("fname calloc: %s"), strerror(errno)); ++ return -errno; ++ } ++ + parms->fd = fd; + parms->fe_flags = flags; + parms->dvb_prop[0].cmd = DTV_API_VERSION; diff -Nru v4l-utils-1.14.2/debian/patches/0008-libdvbv5-fix-double-free-in-dvb_fe_open_fname.patch v4l-utils-1.14.2/debian/patches/0008-libdvbv5-fix-double-free-in-dvb_fe_open_fname.patch --- v4l-utils-1.14.2/debian/patches/0008-libdvbv5-fix-double-free-in-dvb_fe_open_fname.patch 1970-01-01 01:00:00.000000000 +0100 +++ v4l-utils-1.14.2/debian/patches/0008-libdvbv5-fix-double-free-in-dvb_fe_open_fname.patch 2019-04-14 13:33:45.000000000 +0200 @@ -0,0 +1,59 @@ +Subject: libdvbv5: fix double free in dvb_fe_open_fname +Author: Andre Roth +Origin: upstream, https://git.linuxtv.org/v4l-utils.git/commit/?h=stable-1.14&id=25e967319367979e24e93ef1a3c74a1f4111575f +Bug-Ubuntu: https://bugs.launchpad.net/raspbian/+bug/1819650 + +Since parms and fname is allocated outside of the function, do not free it. +Use dvb_v5_free for freeing parms, it will free fname if required. + +Signed-off-by: Andre Roth +Signed-off-by: Mauro Carvalho Chehab +--- + lib/libdvbv5/dvb-fe.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +--- a/lib/libdvbv5/dvb-fe.c ++++ b/lib/libdvbv5/dvb-fe.c +@@ -179,7 +179,7 @@ + + ret = dvb_fe_open_fname(parms, dvb_dev->path, flags); + if (ret < 0) { +- free(parms); ++ dvb_v5_free(parms); + return NULL; + } + +@@ -200,9 +200,7 @@ + + if (xioctl(fd, FE_GET_INFO, &parms->p.info) == -1) { + dvb_perror("FE_GET_INFO"); +- dvb_v5_free(parms); + close(fd); +- free(fname); + return -errno; + } + +@@ -289,7 +287,6 @@ + } + if (!parms->p.num_systems) { + dvb_logerr(_("delivery system not detected")); +- dvb_v5_free(parms); + close(fd); + return -EINVAL; + } +@@ -300,7 +297,6 @@ + dtv_prop.props = parms->dvb_prop; + if (xioctl(fd, FE_GET_PROPERTY, &dtv_prop) == -1) { + dvb_perror("FE_GET_PROPERTY"); +- dvb_v5_free(parms); + close(fd); + return -errno; + } +@@ -310,7 +306,6 @@ + + if (parms->p.num_systems == 0) { + dvb_logerr(_("driver returned 0 supported delivery systems!")); +- dvb_v5_free(parms); + close(fd); + return -EINVAL; + } diff -Nru v4l-utils-1.14.2/debian/patches/series v4l-utils-1.14.2/debian/patches/series --- v4l-utils-1.14.2/debian/patches/series 2018-02-10 13:36:39.000000000 +0100 +++ v4l-utils-1.14.2/debian/patches/series 2019-04-14 13:32:08.000000000 +0200 @@ -1 +1,6 @@ dont-gererate-treeview.diff +0001-libv4lconvert-fix-compiler-warning.patch +0002-include-sys-sysmacros.h-for-major-minor.patch +0003-dvbv5-tools-be-sure-to-zero-struct-arguments.patch +0005-libdvbv5-leaks-and-double-free-in-dvb_fe_open_fname.patch +0008-libdvbv5-fix-double-free-in-dvb_fe_open_fname.patch