assert no null pointer dereference
authorRobin Gareus <robin@gareus.org>
Tue, 18 Nov 2014 20:59:04 +0000 (21:59 +0100)
committerRobin Gareus <robin@gareus.org>
Tue, 18 Nov 2014 20:59:04 +0000 (21:59 +0100)
gtk2_ardour/linux_vst_gui_support.cc

index 5eaf485c7569587ff45bce90c1d9d70828e33282..65039f162db452d8114493d25111c2f85b679963 100644 (file)
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <libgen.h>
+#include <assert.h>
 
 #include <pthread.h>
 #include <signal.h>
@@ -772,6 +773,10 @@ vstfx_event_loop_remove_plugin (VSTState* vstfx)
                }
        }
 
+       // if this function is called, there must be
+       // at least one plugin in the linked list
+       assert(vstfx_first);
+
        if (vstfx_first == vstfx) {
                vstfx_first = vstfx_first->next;
        }