Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs related to setting a string splice to FREAD or FREADn. #415

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

AliceLR
Copy link
Owner

@AliceLR AliceLR commented Jan 17, 2024

Setting a string splice to FREAD now reads bytes to an intermediate buffer, which was required to fix some of the below bugs. Setting a string to FREAD normally or setting any string/splice to FREADn works fundamentally the same as before, except:

  • Setting a string offset, limit, or splice to FREADn now respects the provided limit. If n is larger than the limit, n total bytes will still be read (up to the maximum string size); any bytes read past the limit are discarded.
  • Setting a string offset, limit, or splice to FREAD now respects the provided limit and no longer pads the string with spaces in some cases. Setting any string to FREAD now reads the file until a terminator or the end of the file is found instead of stopping when the maximum string size is reached; any bytes read past the limit or maximum size are discarded.
  • Setting a string splice to FREAD or FREADn with invalid offset or size values no longer causes a crash.
  • Setting a string splice to FREAD with a valid offset that would write past the current length no longer causes a crash.

Setting a string splice to FREAD now reads bytes to an intermediate
buffer, which was required to fix some of the below bugs. Setting a
string to FREAD normally or setting any string/splice to FREADn works
fundamentally the same as before, except:

+ Setting a string offset, limit, or splice to FREADn now
  respects the provided limit. If n is larger than the limit,
  n total bytes will still be read (up to the maximum string
  size); any bytes read past the limit are discarded.
+ Setting a string offset, limit, or splice to FREAD now
  respects the provided limit and no longer pads the string with
  spaces in some cases. Setting any string to FREAD now reads
  the file until a terminator or the end of the file is found
  instead of stopping when the maximum string size is reached;
  any bytes read past the limit or maximum size are discarded.
+ Setting a string splice to FREAD or FREADn with invalid offset
  or size values no longer causes a crash.
+ Setting a string splice to FREAD with a valid offset that
  would write past the current length no longer causes a crash.
@AliceLR AliceLR added this to the 2.93b milestone Jan 17, 2024
@AliceLR AliceLR merged commit 4886518 into master Jan 17, 2024
14 checks passed
@AliceLR AliceLR deleted the fix-string-fread branch January 17, 2024 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant