Index: query_exec.c =================================================================== --- query_exec.c (revision 33065) +++ query_exec.c (revision 33066) @@ -306,6 +306,11 @@ if (argc > PCB_QRY_MAX_FUNC_ARGS) return -1; + if (fdef == NULL) { + rnd_message(RND_MSG_ERROR, "call to unknown/undefined function\n"); + return -1; + } + fctx = *ectx; assert(fdef->type == PCBQ_FUNCTION);