Skip to content

Commit

Permalink
Dear C: Please don't read out of bounds. Thanks.
Browse files Browse the repository at this point in the history
  • Loading branch information
vmg committed Feb 14, 2012
1 parent 684fb92 commit cdec93e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/rugged/rugged_blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static VALUE rb_git_blob_sloc(VALUE self)
* that are not empty */
while (data < data_end) {
if (*data++ == '\n') {
while (isspace(*data))
while (data < data_end && isspace(*data))
data++;

sloc++;
Expand Down

0 comments on commit cdec93e

Please sign in to comment.