Fix insertion of non hex encoded payload data
authorMartin Willi <martin@revosec.ch>
Wed, 10 Nov 2010 16:41:23 +0000 (17:41 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 5 Jan 2011 15:45:44 +0000 (16:45 +0100)
src/conftest/hooks/add_notify.c
src/conftest/hooks/add_payload.c
src/conftest/hooks/unencrypted_notify.c

index 4ae7c2d..0083326 100644 (file)
@@ -85,7 +85,7 @@ METHOD(listener_t, message, bool,
                        data = chunk_skip(chunk_create(this->data, strlen(this->data)), 2);
                        data = chunk_from_hex(data, NULL);
                }
-               else if (data.len)
+               else if (this->data && strlen(this->data))
                {
                        data = chunk_clone(chunk_create(this->data, strlen(this->data)));
                }
index 132bac7..9de18c5 100644 (file)
@@ -82,7 +82,7 @@ METHOD(listener_t, message, bool,
                        data = chunk_skip(chunk_create(this->data, strlen(this->data)), 2);
                        data = chunk_from_hex(data, NULL);
                }
-               else if (data.len)
+               else if (this->data && strlen(this->data))
                {
                        data = chunk_clone(chunk_create(this->data, strlen(this->data)));
                }
index 1d7f42d..8737158 100644 (file)
@@ -80,7 +80,7 @@ METHOD(listener_t, ike_updown, bool,
                        data = chunk_skip(chunk_create(this->data, strlen(this->data)), 2);
                        data = chunk_from_hex(data, NULL);
                }
-               else if (data.len)
+               else if (this->data && strlen(this->data))
                {
                        data = chunk_clone(chunk_create(this->data, strlen(this->data)));
                }