lagarith: fix buffer overreads.