core: Fix ps command truncating strings longer than 256 bytes#5997
Open
cheese-cakee wants to merge 6 commits intorizinorg:devfrom
Open
core: Fix ps command truncating strings longer than 256 bytes#5997cheese-cakee wants to merge 6 commits intorizinorg:devfrom
cheese-cakee wants to merge 6 commits intorizinorg:devfrom
Conversation
0cbb0e8 to
0cc9901
Compare
Refactor RzStrStringifyOpt to use RzBuffer for streaming reads instead of depending on core->block size. This allows ps and its variants to print strings of arbitrary length. * Replace const ut8 *buffer with RzBuffer *buffer in RzStrStringifyOpt * Rewrite rz_str_stringify_raw_buffer to use rz_buf_read_at in chunks * Update all cmd_print.c ps handlers to create RzBuffer wrappers * Add regression test for >256 byte strings
0cc9901 to
2d00576
Compare
notxvilka
requested changes
Mar 6, 2026
wargio
reviewed
Mar 6, 2026
Author
|
done |
notxvilka
requested changes
Mar 7, 2026
| RzCodePoint code_point; | ||
| ut32 n_runes = 0; | ||
| int rsize = 1; // rune size | ||
| b = option->buffer; |
Contributor
There was a problem hiding this comment.
This change is unnecessary, undo this and define variables in-place, like it was before. We use C99 standard, after all.
| if (!section) { | ||
| return; | ||
| } | ||
| ut32 dlength = 0; |
Contributor
There was a problem hiding this comment.
Same here, it's unnecessary, move it back.
Contributor
|
See many compilation errors: And more: https://github.com/rizinorg/rizin/actions/runs/22780588559/job/66129877540?pr=5997 |
Contributor
|
Use the PR template! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4857
The ps command and its variants truncate strings longer than 256 bytes because they depend on core->blocksize. This PR decouples string reading from the static block by switching to RzBuffer for dynamic streaming reads.
Changes
z_str_stringify_raw_buffer to use
z_buf_read_at in small chunks instead of requiring a contiguous memory pointer
z_buf_new_with_pointers return values