openbsd-ports/net/dctc/patches/patch-src_md_c
jasper 267981508a - update dctc to a less ancient version 0.85.9
- merge parts of pkg/SECURITY into pkg/MESSAGE
- fix license marker

feedback and ok ajacoutot@
2008-08-25 15:14:43 +00:00

20 lines
758 B
Plaintext

$OpenBSD: patch-src_md_c,v 1.4 2008/08/25 15:14:43 jasper Exp $
--- src/md.c.orig Sun Dec 28 09:12:38 2003
+++ src/md.c Fri Aug 22 20:32:04 2008
@@ -239,13 +239,13 @@ void md5_process_block (const void *buffer, unsigned c
/****************************************************/
/* convert the given md5sum into a printable string */
/****************************************************/
-void md5tostr(const unsigned char md5sum[MD5SUMLEN],char str[3*MD5SUMLEN+1])
+void md5tostr(const unsigned char md5sum[MD5SUMLEN],char str[3*MD5SUMLEN+1], size_t len)
{
int i;
for(i=0;i<MD5SUMLEN;i++)
{
unsigned int v=md5sum[i];
- sprintf(str+3*i,"%1u%1u%1u",v/100,(v%100)/10,v%10);
+ snprintf(str+3*i,len-3*i,"%1u%1u%1u",v/100,(v%100)/10,v%10);
}
}