diff --git a/libbitdht/src/bitdht/bdmsgs.cc b/libbitdht/src/bitdht/bdmsgs.cc index daccc95da..6f1f7f46e 100644 --- a/libbitdht/src/bitdht/bdmsgs.cc +++ b/libbitdht/src/bitdht/bdmsgs.cc @@ -495,6 +495,10 @@ int beMsgMatchString(be_node *n, const char *str, int len) uint32_t beMsgGetY(be_node *n) { be_node *val = beMsgGetDictNode(n, "y"); + + if(val == NULL) + return BE_Y_UNKNOWN ; + if (val->type != BE_STR) { return BE_Y_UNKNOWN;