add verify for null buffer; fix #17
add test: put null buffer
Merge pull request #18 from coderhaoxin/verify-buffer-length

Verify buffer length