Skip to content

Commit

Permalink
Fix buffer overflow in zero terminator code when reading from a file (#…
Browse files Browse the repository at this point in the history
…170)

Fixes #174
  • Loading branch information
robzed authored Dec 26, 2024
1 parent 7ff4f58 commit 43d49ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion csrc/pfcompil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ DBUGX(("readLineFromStream(0x%x, 0x%x, 0x%x)\n", buffer, len, stream ));
}

/* NUL terminate line to simplify printing when debugging. */
if( (len >= 0) && (len < maxChars) ) p[len] = '\0';
if( (len >= 0) && (len < maxChars) ) *p = '\0';

return len;
}
Expand Down

0 comments on commit 43d49ef

Please sign in to comment.