ossp-pkg/uuid/uuid_md5.c 1.2 -> 1.3
--- uuid_md5.c 2004/01/09 15:51:20 1.2
+++ uuid_md5.c 2004/01/10 10:49:00 1.3
@@ -388,10 +388,11 @@
*data_len = MD5_LEN_BIN;
}
else {
- if (data_len == NULL)
- return MD5_RC_ARG;
- if (*data_len < MD5_LEN_BIN)
- return MD5_RC_MEM;
+ if (data_len != NULL) {
+ if (*data_len < MD5_LEN_BIN)
+ return MD5_RC_MEM;
+ *data_len = MD5_LEN_BIN;
+ }
}
memcpy((void *)(&ctx), (void *)(&(md5->ctx)), sizeof(MD5_CTX));
MD5Final((unsigned char *)(*data_ptr), &(md5->ctx));
@@ -417,10 +418,11 @@
*data_len = MD5_LEN_STR+1;
}
else {
- if (data_len == NULL)
- return MD5_RC_ARG;
- if (*data_len < (MD5_LEN_STR+1))
- return MD5_RC_MEM;
+ if (data_len != NULL) {
+ if (*data_len < MD5_LEN_STR+1)
+ return MD5_RC_MEM;
+ *data_len = MD5_LEN_STR+1;
+ }
}
bufptr = buf;
|
|