Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XrdDig] Fix potentially overflowing call to snprintf
From the man page for snprintf: The functions snprintf() and vsnprintf() do not write more than size bytes (including the terminating null byte ('\0')). If the output was truncated due to this limit, then the return value is the number of characters (excluding the terminating null byte) *which would have been written to the final string if enough space had been available*. Thus, a return value of size or more means that the output was truncated. We therefore need to check if n > buffer size, and act accordingly.
- Loading branch information