XichengTong / SoftwareSupplyChainSecurity_HW1

1 stars 0 forks source link

Standard input validation #5

Closed jackhax closed 2 weeks ago

jackhax commented 2 weeks ago

Have a standard input validation for entire program.

https://github.com/XichengTong/SoftwareSupplyChainSecurity_HW1/blob/e32bee2352c30a83d3f281323abb1bd64c0ea378/main.py#L95

https://github.com/XichengTong/SoftwareSupplyChainSecurity_HW1/blob/e32bee2352c30a83d3f281323abb1bd64c0ea378/main.py#L168

Ex: Validate_log_index(index) A function that validates index anywhere in the program. Similarly a standard sanitization for artifact path as well.

XichengTong commented 2 weeks ago

create def Validate_log_index(log_index): to checks if the log index is an integer and if it is greater than or equal to 0. If the log index fails either condition, it raises a ValueError with an appropriate message.