From: Marcin Jurkowski Date: Mon, 29 Jun 2015 19:01:04 +0000 (+0200) Subject: owfs: avoid npe in BUS_reset function X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=101fc3047c187265a1fcf35b9b1efaad98c5082e;p=openwrt-packages.git owfs: avoid npe in BUS_reset function Monitor adapters (zeroconf, enet, usb and w1) don't have the reset routine, causing null pointer dereference in BUS_reset function. This patch has been submitted upstream: https://sourceforge.net/p/owfs/bugs/67/ Signed-off-by: Marcin Jurkowski --- diff --git a/utils/owfs/patches/101-fix-no-reset-routine-segfault.patch b/utils/owfs/patches/101-fix-no-reset-routine-segfault.patch new file mode 100644 index 000000000..731c4a04e --- /dev/null +++ b/utils/owfs/patches/101-fix-no-reset-routine-segfault.patch @@ -0,0 +1,13 @@ +--- a/module/owlib/src/c/ow_reset.c ++++ b/module/owlib/src/c/ow_reset.c +@@ -21,6 +21,10 @@ RESET_TYPE BUS_reset(const struct parsed + struct connection_in * in = pn->selected_connection ; + STAT_ADD1_BUS(e_bus_resets, in); + ++ if ( in->iroutines.reset == NO_RESET_ROUTINE ) { ++ return BUS_RESET_OK; ++ } ++ + switch ( (in->iroutines.reset) (pn) ) { + case BUS_RESET_OK: + in->reconnect_state = reconnect_ok; // Flag as good!