Also check for empty hash here, too.
authorRoland Haeder <roland@mxchange.org>
Thu, 3 Sep 2015 19:58:41 +0000 (21:58 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 3 Sep 2015 19:58:41 +0000 (21:58 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
application/hub/classes/package/class_NetworkPackage.php

index 3fdc59e..bc47149 100644 (file)
@@ -360,6 +360,12 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
                        //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: senderData=' . print_r($senderData, TRUE));
                        assert(isset($senderData[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_PRIVATE_KEY_HASH]));
 
                        //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: senderData=' . print_r($senderData, TRUE));
                        assert(isset($senderData[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_PRIVATE_KEY_HASH]));
 
+                       // Don't accept empty hashes
+                       if (empty($senderData[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_PRIVATE_KEY_HASH])) {
+                               // Don't accept
+                               die('[' . __METHOD__ . ':' . __LINE__ . ':] Empty private key hash: senderData=' . print_r($senderData, TRUE));
+                       } // END - if
+
                        // Return it
                        return $senderData[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_PRIVATE_KEY_HASH];
                } // END - if
                        // Return it
                        return $senderData[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_PRIVATE_KEY_HASH];
                } // END - if