why would pos ever be negative?

pull/66/head
despair 6 years ago
parent af7b4b75b8
commit ff6a271278

@ -52,6 +52,7 @@ endif()
if(WIN32)
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-bad-function-cast>)
add_compile_options(-Wno-cast-function-type)
set(FS_LIB stdc++fs)
endif(WIN32)

@ -299,7 +299,7 @@ generic_handle_dnsc_recvfrom(dnsc_answer_request *request,
llarp::LogDebug("Read an authority for ",
request->question.name, " at ", std::to_string(pos));
// castBuf += answer->name.length() + 4 + 4 + 4 + answer->rdLen;
if(pos > sz)
if((ssize_t)pos > sz)
{
llarp::LogWarn("Would read past end of dns packet. for ",
request->question.name);

Loading…
Cancel
Save