XS: Ensure created Perl strings are nul-terminated
Most of these are binary strings and shouldn't be interpreted as C strings in the first place, but better be safe in case they are, anyway. The lack of nul-termination of FU::Pg `$hex` strings was more likely to be problematic.
This commit is contained in:
parent
7c765f33bb
commit
0925ae79a1
3 changed files with 5 additions and 0 deletions
|
|
@ -71,6 +71,7 @@ static int fufdpass_recv(pTHX_ I32 ax, int socket, size_t len) {
|
|||
}
|
||||
|
||||
SvCUR_set(buf, r);
|
||||
SvPVX(buf)[r] = 0;
|
||||
ST(1) = buf;
|
||||
return 2;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue