Skip to content

Conversation

@NexiusTailer
Copy link
Contributor

@NexiusTailer NexiusTailer commented Jan 1, 2026

  1. Fix for pretty critical bug in memcpy function: someone suddenly made a change, so now offset is applied to source instead of dest. This way, the function memcpy in omp server still have bounds checking for destination array only, so we could be reading out of bounds from the source array. Funny enough, it wasn't a thing in the last commits in pawn-lang/compiler repo
  2. Fix indentation inside strins function. There should be 2 spaces instead of 4 like everywhere else
  3. Re-add missed comment inside flength which was in original pawn previously, fix typo in comment for "PAWN_CELL_SIZE 64"
  4. Minor format fixes of the recently changed stuff to match the general style

Most of format tweaks were made on purpose, to reduce unnecessary differences in diff checker when comparing it with other forks based on original pawn repo.

@NexiusTailer NexiusTailer force-pushed the master branch 12 times, most recently from 2be6cdc to cb5c820 Compare January 2, 2026 12:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses several important fixes and formatting corrections to align the codebase with the original PAWN repository style:

  • Fixes a critical bug in the memcpy function where the offset was incorrectly applied to the source pointer instead of the destination pointer, potentially causing out-of-bounds reads
  • Corrects indentation throughout the strins function from 4 spaces to 2 spaces for consistency with the rest of the codebase
  • Re-adds a missing comment and fixes a typo in a comment describing cell size

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
source/amx/amxstring.c Fixes critical bug in memcpy (offset now applied to destination instead of source); fixes indentation in strins function from 4 spaces to 2 spaces
source/amx/amxfloat.c Removes extraneous blank line between comment and code in n_floatfract
source/amx/amxfile.c Re-adds missing comment in flength function; adjusts spacing for consistency
source/amx/amxcore.c Minor spacing adjustments in function signatures and parameters for consistency
source/amx/amx.h Fixes typo in comment ("32-bit cells" → "64-bit cells" for __64BIT__ case); reformats multi-line comment to single line
source/amx/amx.c Minor spacing adjustments around operators and in blank lines for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

the bug was introduced in commit e5b7d1a
@NexiusTailer
Copy link
Contributor Author

NexiusTailer commented Jan 2, 2026

I'm sorry for not creating a new PR and adding more stuff here, but it's as important as tiny, so probably no real need in another PR, but still needs to be proposed. Comparing to pawn-lang/compiler, there were rewritten some stuff like amx_PushString and amx_SetString, adding internal amx_PushStringLen and amx_SetStringLen. After the commit e5b7d1a, the code here became inconsistent when calculating string length under different compiler options. Now it's also fixed.

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