I see what you are saying. So that function actually accepts a size_t which is a unsigned type. I now understand why this call to the function went through without any exceptions. When I posted my question, I was referring to this page[1] which claims the type for the "numBytes" to be a signed integer.
[1] https://www.lix.polytechnique.fr/~liberti/public/computing/p...