summaryrefslogtreecommitdiff
path: root/lib/crmf
diff options
context:
space:
mode:
authorTim Taubert <ttaubert@mozilla.com>2016-10-26 20:00:19 +0200
committerTim Taubert <ttaubert@mozilla.com>2016-10-26 20:00:19 +0200
commit9ff427fa9cc70227861e2f4611601a33d5148a10 (patch)
treeb0a16f97fe4c45195c4513132df0d42d4ab9159a /lib/crmf
parent7efeea8fe64b04ac4af90ae08d886b5dd7130061 (diff)
downloadnss-hg-9ff427fa9cc70227861e2f4611601a33d5148a10.tar.gz
Bug 1313123 - Merge UBSan runs back with ASan and fix remaining test suites r=franziskus
Differential Revision: https://nss-dev.phacility.com/D125
Diffstat (limited to 'lib/crmf')
-rw-r--r--lib/crmf/crmfpop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/crmf/crmfpop.c b/lib/crmf/crmfpop.c
index e20353c4e..725f8c730 100644
--- a/lib/crmf/crmfpop.c
+++ b/lib/crmf/crmfpop.c
@@ -125,7 +125,9 @@ crmf_generic_encoder_callback(void *arg, const char *buf, unsigned long len,
encoderArg->allocatedLen = newSize;
}
cursor = &(encoderArg->buffer->data[encoderArg->buffer->len]);
- PORT_Memcpy(cursor, buf, len);
+ if (len) {
+ PORT_Memcpy(cursor, buf, len);
+ }
encoderArg->buffer->len += len;
}