>> >> + buf[len] = '\0'; >> + > > I think it would be more appropriate here to check if buf[len] == '\0' and return an error otherwise. Nevermind, I just had a closer look and I actually think your approach is fine. I hadn't considered the possibility of someone deliberately passing a non-null-terminated string with a specific length. >> Signed-off-by: Miaoqing Pan <miaoqing@xxxxxxxxxxxxxx> Reviewed-by: Christoph Böhmwalder <christoph@xxxxxxxxxxxxxx> -- Regards, Christoph
Attachment:
signature.asc
Description: OpenPGP digital signature