Message ID | 20201123103436.7056-1-al@alarsen.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] qnx4_match: do not over run the buffer | expand |
diff --git a/fs/qnx4/namei.c b/fs/qnx4/namei.c index 8d72221735d7..2bcbbd7c772e 100644 --- a/fs/qnx4/namei.c +++ b/fs/qnx4/namei.c @@ -40,9 +40,7 @@ static int qnx4_match(int len, const char *name, } else { namelen = QNX4_SHORT_NAME_MAX; } - thislen = strlen( de->di_fname ); - if ( thislen > namelen ) - thislen = namelen; + thislen = strnlen( de->di_fname, namelen ); if (len != thislen) { return 0; }