llvm.org GIT mirror llvm / 51f5a1a
Don't pass a null pointer to memcpy. Fixes pr23650. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241617 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 4 years ago
1 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
164164 if (Size > (size_t)(OutBufEnd - OutBufCur))
165165 return write(Str.data(), Size);
166166
167 memcpy(OutBufCur, Str.data(), Size);
168 OutBufCur += Size;
167 if (Size) {
168 memcpy(OutBufCur, Str.data(), Size);
169 OutBufCur += Size;
170 }
169171 return *this;
170172 }
171173