Commit 7ec7a6e5 authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

Fix "null pointer passed to nonnull argument" clang static analyzer warnings. NFCI.

Assert that the memcpy arguments are valid.
parent a705cf1a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -489,7 +489,7 @@ static void Append(char *Start, char *End, char *&Buffer, unsigned &BufferSize,
    Buffer = NewBuffer;
    BufferCapacity = NewCapacity;
  }

  assert(Buffer && Start && End && End > Start && "Illegal memory buffer copy");
  memcpy(Buffer + BufferSize, Start, End - Start);
  BufferSize += End - Start;
}