diff --git a/SOURCES/tigervnc-inetd-crash.patch b/SOURCES/tigervnc-inetd-crash.patch
new file mode 100644
index 0000000..b6445de
--- /dev/null
+++ b/SOURCES/tigervnc-inetd-crash.patch
@@ -0,0 +1,16 @@
+diff --git a/unix/xserver/hw/vnc/xvnc.cc b/unix/xserver/hw/vnc/xvnc.cc
+index 5c0e171..c79ad18 100644
+--- a/unix/xserver/hw/vnc/xvnc.cc
++++ b/unix/xserver/hw/vnc/xvnc.cc
+@@ -352,7 +352,10 @@ static
+ bool displayNumFree(int num)
+ {
+     try {
+-	network::TcpListener l(NULL, 6000+num);
++      // Attempt to create TCPListeners on that port.
++      // They go out of scope immediately and are destroyed.
++      std::list<network::TcpListener> dummy;
++      network::createTcpListeners (&dummy, 0, 6000+num);
+     } catch (rdr::Exception& e) {
+ 	return false;
+     }
diff --git a/SPECS/tigervnc.spec b/SPECS/tigervnc.spec
index b9bdcfc..2e2d47b 100644
--- a/SPECS/tigervnc.spec
+++ b/SPECS/tigervnc.spec
@@ -1,6 +1,6 @@
 Name:           tigervnc
 Version:        1.3.1
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        A TigerVNC remote display system
 
 Group:          User Interface/Desktops
@@ -58,6 +58,7 @@ Patch27:        tigervnc-ipv6-support.patch
 Patch28:        tigervnc-set-initial-mode-as-prefered.patch
 Patch29:        tigervnc-CVE-2014-8241.patch
 Patch30:        tigervnc-1.3.1-CVE-2014-8240.patch
+Patch31:        tigervnc-inetd-crash.patch
 
 # This is tigervnc-%{version}/unix/xserver116.patch rebased on the latest xorg
 Patch100:       tigervnc-xserver117.patch
@@ -218,6 +219,9 @@ popd
 # buffer overflow in screen size handling
 %patch30 -p1 -b .tigervnc-1.3.1-CVE-2014-8240
 
+# Bug 1283925 - segfault in network::TcpListener::TcpListener
+%patch31 -p1 -b .tigervnc-inetd-crash
+
 %build
 %ifarch sparcv9 sparc64 s390 s390x
 export CFLAGS="$RPM_OPT_FLAGS -fPIC"
@@ -387,6 +391,10 @@ fi
 %{_datadir}/icons/hicolor/*/apps/*
 
 %changelog
+* Tue Feb 02 2016 Jan Grulich <jgrulich@redhat.com> - 1.3.1-4
+- Do not crash when using -inetd option
+  Resolves: bz#1304700
+
 * Wed Sep 02 2015 Jan Grulich <jgrulich@redhat.com> - 1.3.1-3
 - Do not mention that display number is required in the file name
   Resolves: bz#1195266