patch from Gerrit: 08_hostlist__hostrange_to_string.diff
hostrange_to_string(): truncation checks * turned 'truncated' variable into jump label; * loop changes so that the pre-condition is always len < n: - if len >= n inside the loop, the a jump to 'truncated' follows, - hence loop post-condition is also len < n, so that buf[len] = '\0' works; * consistently check ret=snprintf() for "ret < 0 || (len += ret) >= n", - if dims > 1, also tests to ensure that len + dims < n, - further overflow test after incrementing len for separator; * moved separator test up (inserted when i > hr->lo) (to avoid having to undo the last separator).
Please register or sign in to comment