No, there is no such problem, because the cycle continues only when * s1 and * s2 are equal, and * s2 is not 0. If s1 is shorter, then when it gets to \ 0 at the end of s1, the equality condition will be interrupted, and the cycle will stop .
source
share