]> git.ipfire.org Git - thirdparty/libarchive.git/commit
calling strlen() with null pointer (#1142)
authorPatrick Cheng <patcheng@users.noreply.github.com>
Wed, 20 Feb 2019 00:55:19 +0000 (16:55 -0800)
committerMartin Matuška <martin@matuska.org>
Wed, 20 Feb 2019 00:55:19 +0000 (01:55 +0100)
commitbe92846ba46e1abc87482be74f74c2f54a3b9ad9
tree91a088635444b73379310705b454846a6d609036
parent3532bc32819b14bfd8a3a5e3d3554ce14d939940
calling strlen() with null pointer (#1142)

clang analyzer found this issue.

other archive_mstring_copy_* has the pattern:

```
if (xxx == NULL) {
  aes->aes_set = 0;
  return (0);
}
```

archive_mstring_copy_utf8() didn't follow that pattern, so if NULL is passed in, it will call strlen(NULL).

Noticed that archive_mstring_copy_wcs_len() doesn't follow the pattern either.

Fixes #1142
libarchive/archive_string.c