Backport off-by-one fix in 1352073
As a defense in depth we should backport the off-by-one error fix in https://bugzilla.mozilla.org/show_bug.cgi?id=1352073.
As a defense in depth we should backport the off-by-one error fix in https://bugzilla.mozilla.org/show_bug.cgi?id=1352073.