Commit 1c743cd
Dmitrii Chervov
UCT/IB/BASE: Fix roce ndev name read
If a network interface name have a length of 15 (maximum allowed)
and we are trying to read it to a buffer of 16 bytes size, here
whats happen:
1) in function "ucs_read_file_str" MAX length will be decreased
(now it is 15);
2) in function "ucs_read_file_vararg" there are "read" call that
uses new MAX length (15) minus one (so it became 14).
3) If our name have maximum size we cannot read it fully, and
it will be an error, becaus we cannot get it index from name.
It is oblivious that first size decrease was for '\0' null byte,
but the second is a bug. So i replaces "ucs_read_file_str" that
do the negation to a "ucs_read_file" where it didn`t happening.1 parent 532ed09 commit 1c743cd
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1499 | 1499 | | |
1500 | 1500 | | |
1501 | 1501 | | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
1505 | 1505 | | |
1506 | 1506 | | |
1507 | 1507 | | |
| |||
0 commit comments