* [ext4:unicode 2/10] fs/unicode/utf8-norm.c:199 utf8nlookup() warn: variable dereferenced before check 'data' (see line 193)
@ 2019-04-08 6:28 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2019-04-08 6:28 UTC (permalink / raw)
To: kbuild, Olaf Weber
Cc: kbuild-all, linux-ext4, Theodore Ts'o,
Gabriel Krisman Bertazi
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git unicode
head: c0ae3a05c89c497446d6e208b68623993b5afc3c
commit: e57d9d28d2810e8db572cb2720fd6024c0b11de4 [2/10] unicode: introduce code for UTF-8 normalization
smatch warnings:
fs/unicode/utf8-norm.c:199 utf8nlookup() warn: variable dereferenced before check 'data' (see line 193)
# https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/commit/?id=e57d9d28d2810e8db572cb2720fd6024c0b11de4
git remote add ext4 https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
git remote update ext4
git checkout e57d9d28d2810e8db572cb2720fd6024c0b11de4
vim +/data +199 fs/unicode/utf8-norm.c
e57d9d28 Olaf Weber 2019-03-18 181
e57d9d28 Olaf Weber 2019-03-18 182 /*
e57d9d28 Olaf Weber 2019-03-18 183 * Use trie to scan s, touching at most len bytes.
e57d9d28 Olaf Weber 2019-03-18 184 * Returns the leaf if one exists, NULL otherwise.
e57d9d28 Olaf Weber 2019-03-18 185 *
e57d9d28 Olaf Weber 2019-03-18 186 * A non-NULL return guarantees that the UTF-8 sequence starting at s
e57d9d28 Olaf Weber 2019-03-18 187 * is well-formed and corresponds to a known unicode code point. The
e57d9d28 Olaf Weber 2019-03-18 188 * shorthand for this will be "is valid UTF-8 unicode".
e57d9d28 Olaf Weber 2019-03-18 189 */
e57d9d28 Olaf Weber 2019-03-18 190 static utf8leaf_t *utf8nlookup(const struct utf8data *data, const char *s,
e57d9d28 Olaf Weber 2019-03-18 191 size_t len)
e57d9d28 Olaf Weber 2019-03-18 192 {
e57d9d28 Olaf Weber 2019-03-18 @193 utf8trie_t *trie = utf8data + data->offset;
^^^^^^^^^^^^
e57d9d28 Olaf Weber 2019-03-18 194 int offlen;
e57d9d28 Olaf Weber 2019-03-18 195 int offset;
e57d9d28 Olaf Weber 2019-03-18 196 int mask;
e57d9d28 Olaf Weber 2019-03-18 197 int node;
e57d9d28 Olaf Weber 2019-03-18 198
e57d9d28 Olaf Weber 2019-03-18 @199 if (!data)
^^^^
Too late.
e57d9d28 Olaf Weber 2019-03-18 200 return NULL;
e57d9d28 Olaf Weber 2019-03-18 201 if (len == 0)
e57d9d28 Olaf Weber 2019-03-18 202 return NULL;
e57d9d28 Olaf Weber 2019-03-18 203 node = 1;
e57d9d28 Olaf Weber 2019-03-18 204 while (node) {
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-04-08 6:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-08 6:28 [ext4:unicode 2/10] fs/unicode/utf8-norm.c:199 utf8nlookup() warn: variable dereferenced before check 'data' (see line 193) Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox