## Sheet 2 Exercise 1a Rule 5

Lukas.Sommer
Windoof-User
Beiträge: 30
Registriert: 12. Okt 2011 16:36

### Sheet 2 Exercise 1a Rule 5

Hello everybody,

I have a question regarding rule 5 from exercise 1. Either I got the rule wrong or the formulation is somewhat mistakable.
My understanding of the formulation printed on the sheet is the following: If we have a statement

Code: Alles auswählen

x = c.b 
in the programm and x was tainted before c would be tainted afterwards. This doesn't make sense to me, I would instead expect x to be tainted afterwards, if c was tainted before. In my opinion, the rule should be formulated like:
If the right side of an assignment is an instance field reference, the left side is tainted if the base object of the right side is tainted.
Did I misinterpret that rule or is the formulation in the sheet wrong?

Greetings
Lukas

Neuling
Beiträge: 7
Registriert: 16. Okt 2014 08:10

### Re: Sheet 2 Exercise 1a Rule 5

Same question, I would appreciate to get explanation about rule 4 too.

Johannes Spaeth
Erstie
Beiträge: 11
Registriert: 30. Okt 2014 13:29

### Re: Sheet 2 Exercise 1a Rule 5

Hi Lukas,

you are absolutely right, there was a mistake in the formulation and it
should be in the way in which you stated the rule.

We updated the exercise sheet in the SVN and the rule is now:
If the right side of an assignment is an instance field reference, and the base of the right side is tainted the left side is tainted.

About rule 4 if we have a statement of the form

Code: Alles auswählen

a.c = x
and x is tainted before the statement, the base object a should be tainted afterwards (even though the field gets actually tainted.)

Best regards,

Johannes

Lukas.Sommer
Windoof-User
Beiträge: 30
Registriert: 12. Okt 2011 16:36

### Re: Sheet 2 Exercise 1a Rule 5

Hi Johannes,

Should the new formulation of rule 5 only be applicable for locals on the left-hand side or for all kinds of values on the left-hand side?

Greetings,

Lukas

Johannes Spaeth
Erstie
Beiträge: 11
Registriert: 30. Okt 2014 13:29

### Re: Sheet 2 Exercise 1a Rule 5

Hi Lukas,

yes, you just need to treat locals, that is perfectly fine for the moment!