Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
Let's Play a Game

Let's Play a Game

18 Sep 2014
Author:

The authors of the PVS-Studio analyzer invite you to test your attentiveness.

Code analyzers never get tired and can find errors a human's eye cannot easily notice. We have picked a few code fragments with errors revealed by PVS-Studio, all the fragments taken from well-known open-source projects.

We invite you to take part in a competition against code analyzers to test your agility by trying to find the errors by yourself. You will be offered 15 randomly selected tasks. Every correct answer earns you one score if you give it within 60 seconds. The code fragments are short and 60 seconds is a fair limit.

Let's examine a couple of examples with errors for you to understand how to give the answer.

Example one. You see the following code:

The error here is marked red, but there won't be any marking for you when solving tasks, of course.

The programmer has made a typo and written index 3 instead of 2. When moving the cursor above the code, various words and numbers will be highlighted. You should point the cursor at number 3 and click the left mouse button.

That will be the right answer.

Example two. It's not always possible to give one definite answer:

The buffer size is to be compared to number 48. The programmer accidentally wrote an excess sizeof() operator, which will result in comparing the buffer size to the size of the int type.

In my opinion, it is the "sizeof" operator which is a mistake here and this is the word you should point the mouse at. However, without knowing the complete program text, one may go another way in one's thinking: the 'sizeof' operator was to calculate the size of some buffer but was mistakenly fed a macro. The error then is in "SSL3_MASTER_SECRET_LENGTH".

For cases like this, both answers (whether "sizeof" or "SSL3_MASTER_SECRET_LENGTH") will count as correct.

Good luck. Start the game.

P.S. We understand that the tasks are not perfect; it's not always clear where exactly you should

"hit" with the mouse, and the system can be cheated. Just remember that this site section was created purely for fun's sake, not for detailed and reliable testing of someone's abilities.

Popular related articles

S'abonner

Comments (0)

close comment form
close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I want to join the test
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si l'e-mail n'apparaît pas dans votre boîte de réception, recherchez-le dans l'un des dossiers suivants:

  • Promotion
  • Notifications
  • Spam