Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quiz question
Message
De
18/05/2014 02:37:15
 
 
À
18/05/2014 00:00:21
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01600139
Message ID:
01600170
Vues:
44
>>From the GCHG competition :
>>
>>Q. Sometimes security vulnerabilities are simple coding mistakes that even the most seasoned developers can make. What is wrong with the following lines of (C#) code to compute a date range to filter a list of results? What would be a better approach?
var currentDate = DateTime.Now;
>>var startDate = new DateTime(currentDate.Year - 1, currentDate.Month, currentDate.Day);
>>var endDate = currentDate;
>>// Filter the results etc.
>
>There is a possibility of today's date being Feb 29. In this case the code will generate an error.
>
>(I haven't checked other answers yet).

Half marks - you identified the problem but didn't provide a solution :-}
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform