==1== Memcheck, a memory error detector
==1== Copyright (C) 2002-2026, and GNU GPL'd, by Julian Seward et al.
==1== Using Valgrind-3.27.1 and LibVEX; rerun with -h for copyright info
==1== Command: ./build/hdrcat /poc/large.txt
==1== 
==1== Invalid write of size 2
==1==    at 0x48501B3: memmove (vg_replace_strmem.c:1429)
==1==    by 0x40102D: util_copy_value (util.c:15)
==1==    by 0x400D91: hdr_parse_line (hdr.c:104)
==1==    by 0x400F11: hdr_parse_block (hdr.c:134)
==1==    by 0x4009EC: main (hdrcat.c:122)
==1==  Address 0x4a5e7b0 is 0 bytes after a block of size 64 alloc'd
==1==    at 0x4841AE6: malloc (vg_replace_malloc.c:447)
==1==    by 0x401004: util_copy_value (util.c:11)
==1==    by 0x400D91: hdr_parse_line (hdr.c:104)
==1==    by 0x400F11: hdr_parse_block (hdr.c:134)
==1==    by 0x4009EC: main (hdrcat.c:122)
==1== 

valgrind: m_mallocfree.c:304 (get_bszB_as_is): Assertion 'bszB_lo == bszB_hi' failed.
valgrind: Heap block lo/hi size mismatch: lo = 128, hi = 4702111234474983745.
This is probably caused by your program erroneously writing past the
end of a heap block and corrupting heap metadata.  If you fix any
invalid writes reported by Memcheck, this assertion failure will
probably go away.  Please try that before reporting this as a bug.


host stacktrace:
==1==    at 0x58053B1F: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==1==    by 0x5804FC83: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==1==    by 0x5804FE9B: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==1==    by 0x58047EF8: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==1==    by 0x5804846F: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==1==    by 0x5804ACA3: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==1==    by 0x5804AFD5: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
==1==    by 0x1002D98F92: ???
==1==    by 0x1002CA5E7F: ???

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable (lwpid 1)
==1==    at 0x401039: util_copy_value (util.c:16)
==1==    by 0x400D91: hdr_parse_line (hdr.c:104)
==1==    by 0x400F11: hdr_parse_block (hdr.c:134)
==1==    by 0x4009EC: main (hdrcat.c:122)
client stack range: [0x1FFEFFE000 0x1FFF000FFF] client SP: 0x1FFF0009E0
valgrind stack range: [0x1002BA6000 0x1002CA5FFF] top usage: 10176 of 1048576


Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.

If that doesn't help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what OS and version you are using.  Thanks.

