Skip to content

Fix/security optimization - #6

Merged
frapank merged 2 commits into
mainfrom
fix/security-optimization
Jul 3, 2026
Merged

frapank merged 2 commits into
mainfrom
fix/security-optimization

Conversation

@frapank

@frapank frapank commented Jul 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

@frapank
frapank merged commit b39f62d into main Jul 3, 2026
3 checks passed
@frapank
frapank deleted the fix/security-optimization branch July 3, 2026 15:20
frapank added 2 commits July 3, 2026 19:17
If s2 points inside s1 (e.g. dstrappend(s, s + i)), dstrreserve() can
realloc s1's buffer and invalidate s2 before the copy happens. Detect
the aliasing before reserving and re-derive s2 from the new buffer.
dstrcat_base/dstrpush_base/dstrappend_base now grow capacity by 1.5x
via _dstr_grow_cap() instead of reserving exactly what's needed,
avoiding O(n^2) reallocations under repeated growth. dstrfind() now
scans with memchr() for the first byte instead of memcmp()-ing at
every position.
frapank added a commit that referenced this pull request Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant