Commit 54a2817
committed
Address Copilot review feedback
- ReturnValue: report actual valLen via unchecked((int)valLen) instead of
int.MaxValue for more actionable error diagnostics
- TryReadSqlDateTime: use TdsEnums.MaxDateTimeLength constant instead of
local const for consistency with other bounds checks
- SqlConnectionInternal: use ParsingErrorLength for session-recovery check
to include the offending length in the error
- TdsEnums: broaden MaxTokenDataLength comment scope (not login-only),
add MaxDateTimeLength constant
- FeatureExtAckBoundsTests: rewrite boundary test to inject token at
exactly MaxTokenDataLength and assert bounds check does not fire
- TdsTokenBoundsTests: fix DateTime test comment (heap, not stack)1 parent 3bb0e4c commit 54a2817
5 files changed
Lines changed: 41 additions & 33 deletions
File tree
- src/Microsoft.Data.SqlClient
- src/Microsoft/Data/SqlClient
- Connection
- tests/UnitTests/SimulatedServerTests
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1348 | 1348 | | |
1349 | 1349 | | |
1350 | 1350 | | |
1351 | | - | |
| 1351 | + | |
1352 | 1352 | | |
1353 | 1353 | | |
1354 | 1354 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4940 | 4940 | | |
4941 | 4941 | | |
4942 | 4942 | | |
4943 | | - | |
| 4943 | + | |
4944 | 4944 | | |
4945 | 4945 | | |
4946 | 4946 | | |
| |||
7141 | 7141 | | |
7142 | 7142 | | |
7143 | 7143 | | |
7144 | | - | |
7145 | | - | |
| 7144 | + | |
7146 | 7145 | | |
7147 | 7146 | | |
7148 | 7147 | | |
7149 | 7148 | | |
7150 | | - | |
| 7149 | + | |
7151 | 7150 | | |
7152 | 7151 | | |
7153 | 7152 | | |
| |||
Lines changed: 31 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
94 | 92 | | |
95 | 93 | | |
96 | | - | |
97 | 94 | | |
98 | | - | |
| 95 | + | |
99 | 96 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
112 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
113 | 110 | | |
114 | 111 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
| 510 | + | |
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| |||
0 commit comments