os_dbd

* fix compiler warnings
* tighten function headers
* fix potential null-pointer dereference
* fix CID 28508