Skip to content

Commit 77d7db3

Browse files
authored
Merge pull request #1895 from calumgrant/cs/date-queries
C#: Tidy up cs/unsafe-year-construction and cs/mishandling-japanese-era
2 parents 745e321 + 3734552 commit 77d7db3

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

change-notes/1.23/analysis-csharp.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
The following changes in version 1.23 affect C# analysis in all applications.
44

5+
## New queries
6+
7+
## New queries
8+
9+
| **Query** | **Tags** | **Purpose** |
10+
|-----------------------------|-----------|--------------------------------------------------------------------|
11+
| Unsafe year argument for 'DateTime' constructor (`cs/unsafe-year-construction`) | reliability, date-time | Finds incorrect manipulation of `DateTime` values, which could lead to invalid dates. |
12+
| Mishandling the Japanese era start date (`cs/mishandling-japanese-era`) | reliability, date-time | Finds hard-coded Japanese era start dates that could be invalid. |
13+
514
## Changes to existing queries
615

716
| **Query** | **Expected impact** | **Change** |

csharp/ql/src/Likely Bugs/LeapYear/UnsafeYearConstruction.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
22
* @name Unsafe year argument for 'DateTime' constructor
3-
* @description Constructing a 'DateTime' struct by setting the year argument to an increment or decrement of the year of a different 'DateTime' struct
3+
* @description Constructing a 'DateTime' struct by setting the year argument to an increment or decrement of the year of a different 'DateTime' struct.
44
* @kind path-problem
5-
* @problem.severity error
5+
* @problem.severity warning
6+
* @precision medium
67
* @id cs/unsafe-year-construction
7-
* @tags security
8-
* date-time
8+
* @tags date-time
99
* reliability
1010
*/
1111

csharp/ql/src/Likely Bugs/MishandlingJapaneseEra.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @id cs/mishandling-japanese-era
55
* @kind problem
66
* @problem.severity warning
7+
* @precision medium
78
* @tags reliability
89
* date-time
910
*/

0 commit comments

Comments
 (0)