std: Fix an invalid read in from_c_multistring
When `count` is `Some` this function was reading a byte past the end of the buffer.
This commit is contained in:
parent
460021bdf2
commit
fd0fcba9f5
|
@ -1107,8 +1107,8 @@ pub mod raw {
|
||||||
Some(limit) => (true, limit),
|
Some(limit) => (true, limit),
|
||||||
None => (false, 0)
|
None => (false, 0)
|
||||||
};
|
};
|
||||||
while(*(curr_ptr as *libc::c_char) != 0 as libc::c_char
|
while(((limited_count && ctr < limit) || !limited_count)
|
||||||
&& ((limited_count && ctr < limit) || !limited_count)) {
|
&& *(curr_ptr as *libc::c_char) != 0 as libc::c_char) {
|
||||||
let env_pair = from_c_str(
|
let env_pair = from_c_str(
|
||||||
curr_ptr as *libc::c_char);
|
curr_ptr as *libc::c_char);
|
||||||
result.push(env_pair);
|
result.push(env_pair);
|
||||||
|
|
Loading…
Reference in New Issue