fix boundscheck

was checking upper bounds, but not lower bounds. This change fixes that.
This commit is contained in:
Ilja van Sprundel 2019-10-05 22:57:30 +02:00 committed by GitHub
parent 439ac04a65
commit 37230bf0c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -412,7 +412,7 @@ int do_vsafecopy(struct proc * caller, message * m_ptr)
/* No. of vector elements. */
els = m_ptr->m_lsys_kern_vsafecopy.vec_size;
if (els > SCPVEC_NR) {
if (els < 0 || els > SCPVEC_NR) {
return EINVAL;
}
bytes = els * sizeof(struct vscp_vec);