coverity/13758: Out-of-bounds read: FP.

Problem    : Out-of-bounds read from a buffer.
Diagnostic : False positive.
Rationale  : Suggested error path implies isupper(*str) being true,
             which makes error vanish. Coverity just fails to take into
             account isupper() postcondition.
Resolution : Assert isupper() postcondition.
This commit is contained in:
Eliseo Martínez 2014-12-31 20:08:18 +01:00
parent 641f79099f
commit 0f029454ad

View File

@ -1219,8 +1219,10 @@ int read_viminfo_filemark(vir_T *virp, int force)
}
} else if (VIM_ISDIGIT(*str))
fm = &namedfm[*str - '0' + NMARKS];
else
else { // is uppercase
assert(*str >= 'A' && *str <= 'Z');
fm = &namedfm[*str - 'A'];
}
if (fm != NULL && (fm->fmark.mark.lnum == 0 || force)) {
str = skipwhite(str + 1);
fm->fmark.mark.lnum = getdigits(&str);