# HG changeset patch # User Guido Berhoerster # Date 1547109316 -3600 # Node ID 1c0e7f79e737e440fdd5977ed22b443a7bfcddef # Parent b3fc9f7e2b434cca4e44e15bb97c346fe6f716db Fix incorrect field size for text fields The field size should be the string length excluding the terminating null byte which is there for convenience only when using the C API and not part of the on-disk format. diff -r b3fc9f7e2b43 -r 1c0e7f79e737 pws-field.c --- a/pws-field.c Thu Jan 10 08:05:32 2019 +0100 +++ b/pws-field.c Thu Jan 10 09:35:16 2019 +0100 @@ -199,8 +199,8 @@ return (-1); } field->value.text = t; - field->size = len + 1; - memcpy(field->value.text, s, field->size); + field->size = len; + memcpy(field->value.text, s, len + 1); return (0); }