avoid out of bounds string access

as demonstrated by ooo110088-1.doc

Change-Id: I1df32536c1eb78e3ba93885df78328fde894c186