Return error when extension is longer than truncation limit. (cherry picked from commit c667e53638)
c667e53638