commit | 4d50972ad74cc121cf8c885f08ad2a9fa2a45497 | [log] [tgz] |
---|---|---|
author | Greg Kaiser <gkaiser@google.com> | Mon May 07 06:39:34 2018 -0700 |
committer | Greg Kaiser <gkaiser@google.com> | Mon May 07 06:47:16 2018 -0700 |
tree | 1fdc866a73aa22eaf655195573dfb873003b2093 | |
parent | fa073f498899aca52f20d2333dfe0c183d9556aa [diff] |
Avoid potential non-terminated string The method strncpy() does not null-terminated the destination in the event that the source doesn't fit. So we assure our 'name' is null-terminated before we take its length. We also change another strncpy() call to memcpy(), to represent exactly what it is (the copy of an exactly known number of bytes, since we've already determined the string length). Test: Treehugger Change-Id: I55152c57b06f5a1f7322e6d36c73b3a582fd5e49