aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/eol.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-10-21 20:28:23 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-10-21 20:28:23 +0200
commite9bef20a8ad89d304fe3e8fafa00056d22de2326 (patch)
treed83f3be54476fb2b082e09a69a3411d389a9c2e1 /src/eol.c
parent7e37a9711aa163fb6683c4724abe0e2be2bc8a01 (diff)
downloadsciteco-e9bef20a8ad89d304fe3e8fafa00056d22de2326.tar.gz
<EC>: fixed insertion of data garbage (invalid reads) and omissions
* This has only ever observed on Win32, probably because the spawning behaves very differently. * The stdout watcher could be invoked even after removing the source, so we must be secured against it - this was causing some overflows and invalid reads. * Also, teco_eol_reader_convert() could return 0 even after process termination, which would sometimes result in too few bytes being inserted. This could be provoked relatively easily by invoking ECdir$ repeatedly.
Diffstat (limited to 'src/eol.c')
-rw-r--r--src/eol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eol.c b/src/eol.c
index 3439869..9e80b96 100644
--- a/src/eol.c
+++ b/src/eol.c
@@ -126,7 +126,7 @@ teco_eol_reader_convert(teco_eol_reader_t *ctx, gchar **ret, gsize *data_len, GE
}
ctx->offset += ctx->block_len;
- if (ctx->offset == ctx->read_len) {
+ if (ctx->offset >= ctx->read_len) {
ctx->offset = 0;
switch (ctx->read_cb(ctx, &ctx->read_len, error)) {