[PRISM] Use RSTRING_LEN for Prism stream parsing

This commit is contained in:
Kevin Newton 2024-07-17 14:13:16 -04:00
parent 278bbd7b45
commit 7de2c06352
No known key found for this signature in database
GPG Key ID: 0EAD74C79EC73F26

View File

@ -10485,7 +10485,7 @@ pm_parse_stdin_fgets(char *string, int size, void *stream)
}
const char *cstr = StringValuePtr(line);
long length = rb_str_strlen(line);
long length = RSTRING_LEN(line);
memcpy(string, cstr, length);
string[length] = '\0';