Check if subset calculation actually yields a TS in Unity narrowing
authorMartin Willi <martin@revosec.ch>
Tue, 24 Jul 2012 10:20:32 +0000 (12:20 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 18 Sep 2012 15:17:47 +0000 (17:17 +0200)
src/libcharon/plugins/unity/unity_narrow.c

index dada26d..a5fcfab 100644 (file)
@@ -53,7 +53,11 @@ METHOD(listener_t, narrow, bool,
                        {       /* got one, replace original TS */
                                remote->remove_first(remote, (void**)&orig);
                        }
-                       remote->insert_last(remote, orig->get_subset(orig, current));
+                       current = orig->get_subset(orig, current);
+                       if (current)
+                       {
+                               remote->insert_last(remote, current);
+                       }
                }
                enumerator->destroy(enumerator);
                if (orig)