coverity#1202818 improper use of negative value

Change-Id: I2b5fed2f9f9d6a4aa6a8087843fa1805c2d1ffe4
make sure nEnd is after nBegin

Change-Id: Ic3cf41b21755c5f1e795ed3acb97ff83512b7613
coverity#982450 Explicit null dereferenced

Change-Id: I7097ce6ffc86038966a2f436300f49b51ff81977
coverity#738940 Uninitialized pointer field

Change-Id: I467c9ad530b376fd2a23110e4ff157ad03d23d57
coverity#738629 Uninitialized scalar field

Change-Id: Ic3bed7a422ba2073a32aefc6d44a7a4908fae8e0
coverity#738628 Uninitialized scalar field

Change-Id: Ib14384f8212ae03bee4bb5ea9746681287323be4