From 9e8b78eb15ca81518e6dfd95244253388ca5cf81 Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser hiddenalpha.ch Date: Fri, 11 Oct 2024 16:46:35 +0200 Subject: Fix bug of bad length. --- contrib/build-env-setup/setup | 2 +- src/bulk_ln/bulk_ln.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/build-env-setup/setup b/contrib/build-env-setup/setup index 31c5f11..b9f0f28 100644 --- a/contrib/build-env-setup/setup +++ b/contrib/build-env-setup/setup @@ -27,6 +27,6 @@ true \ && find . -not -wholename './dist*' -delete \ && ${PKGDEL:?} $PKGS_TO_DEL && ${PKGCLEAN:?} \ && dirOfDistBundle="$(realpath dist)" \ - && printf '\n SUCCESS :) Distribution bundle is ready in:\n\n %s\n\n Tip: Before pulling out your hair about how to get that archive out of\n your qemu VM. STOP kluding around with silly tools and learn how\n basic tools do the job perfectly fine:\n\n ssh %s@localhost -p2222 -- sh -c '\''true && cd "%s" && tar c *'\'' | tar x\n\n BTW: In addition bulk-ln got installed and is ready-to-use.\n\n' "${dirOfDistBundle:?}" "$USER" "${dirOfDistBundle:?}" \ + && printf '\n SUCCESS :) Distribution bundle is ready in:\n\n %s\n\n Tip: Before pulling out your hair about how to get that archive out of\n your qemu VM. STOP kluding around with silly tools and learn how\n basic tools do the job perfectly fine:\n\n ssh %s@localhost -p%d -T '\''true && cd "%s" && tar c *'\'' | tar x\n\n BTW: In addition bulk-ln got installed and is ready-to-use.\n\n' "${dirOfDistBundle:?}" "$USER" "$(env|grep SSH_CLIENT|cut -d' ' -f3)" "${dirOfDistBundle:?}" \ && true diff --git a/src/bulk_ln/bulk_ln.c b/src/bulk_ln/bulk_ln.c index ae9e51c..9b7c7ca 100644 --- a/src/bulk_ln/bulk_ln.c +++ b/src/bulk_ln/bulk_ln.c @@ -350,7 +350,7 @@ static int parseDataFileAsPairPerLine( BulkLn*bulkLn ){ bulkLn->dataFilePath, lineNum); err = -1; goto finally; } - char *unwantedTab = memchr(tab + 1, DATA_FILE_FIELD_SEP_CHR, tab + 1 - buf); + char *unwantedTab = memchr(tab + 1, DATA_FILE_FIELD_SEP_CHR, buf_len - (tab - buf + 2)); if( unwantedTab != NULL ){ fprintf(stderr, "Too many field separators (tab) in '%s' @ %lu\n", bulkLn->dataFilePath, lineNum); -- cgit v1.1