Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 24cce23

Browse files
committed
text: Null-terminate a string if we've been gouging it
1 parent b7fb71e commit 24cce23

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/buf_text.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ int git_buf_text_lf_to_crlf(git_buf *tgt, const git_buf *src)
143143
tgt->ptr[tgt->size++] = '\n';
144144
}
145145

146+
tgt->ptr[tgt->size] = '\0';
146147
return git_buf_put(tgt, scan, end - scan);
147148
}
148149

0 commit comments

Comments
 (0)