Check slice count and input buffer size before constructing a possibly invalid pointer, not after.
Attach a file by drag & drop or click to upload