Also return a boolean for the readonly flag.
Other cleanup: make sure to set an exception when returning NULL and
reformat the getsets to be shorter by putting them all on one line.
be answered with the comments removed.
There are many places that require checks when doing arithmetic for memory
sizes when allocating memory. Otherwise, overflow is possible with
a subsequent crash.
Fix SF #1777057 which was a result of not initializing the new BufferError
properly. Had to update the test for exceptions for BufferError too.