dns - PHP Warning: unpack(): Type n: not enough input - log entry -


so have found error log

php warning:  unpack(): type n: not enough input, need 2, have 0 in {{file}}{{line}} 

the said file , line contains code:

$answerheader    = unpack('ntype/nclass/nttl/nlength', $answerheaderbin); 

this part of code makes query on dns. issue don;t know how debug this. if try dump before mentioned header information correct. tried unpack() no arguments , returns false no errors.

so guess, question is: in situation warning appear in error log?

turns out warning appears when input data not correct, if expects more characters unpack provided amount, in case unpack() function evaluates false.


Comments

Popular posts from this blog

java - Incorrect order of records in M-M relationship in hibernate -

command line - Use qwinsta in PowerShell ISE -

ruby - Net::HTTP extremely slow responses for HTTPS requests -