From cfdbfa6b2cc27ae5b98c5f27599bbc0fc6a104c1 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 14 Mar 2018 23:53:43 -0400 Subject: Catch more possible instances of passing NULL to memcpy. Actually fixes #1976. --- src/libstore/download.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libstore/download.cc') diff --git a/src/libstore/download.cc b/src/libstore/download.cc index 5ab625f42288..9d9f1153f4d5 100644 --- a/src/libstore/download.cc +++ b/src/libstore/download.cc @@ -195,6 +195,7 @@ struct CurlDownloader : public Downloader if (readOffset == request.data->length()) return 0; auto count = std::min(size * nitems, request.data->length() - readOffset); + assert(count); memcpy(buffer, request.data->data() + readOffset, count); readOffset += count; return count; -- cgit 1.4.1