radon-project / radon

The Radon Programming Language
https://radon-project.github.io
GNU General Public License v3.0
23 stars 2 forks source link

Fix slicing #117

Closed angelcaru closed 2 months ago

angelcaru commented 2 months ago

Closes #114

Almas-Ali commented 2 months ago

This is an exception TypeError: cannot unpack non-iterable NoneType object

my_arr[::-1]

Some other reverse modes need to be tested.

Almas-Ali commented 2 months ago

Only Radon exceptions are valid. If anything throws Python exception then that's a bug.

# Python exception - ValueError: slice step cannot be zero
my_arr[-6:-1:0]

# Python exception - TypeError: cannot unpack non-iterable NoneType object
my_arr[:4:]
my_arr[2::] 
my_arr[::]

# expected syntax error
my_arr[] 

More combinations need to be tested.

Almas-Ali commented 2 months ago

Many places we have used {self!r}. As a result, when an error occurs, the entire data is displayed on the console, which is vulnerable. Instead we should think of something else.

angelcaru commented 2 months ago
  1. What data? This is a program running on a local machine. If you're exposing it to the Internet and leak data, that's the problem of the developer, not of the language
  2. What does this have to do with my PR?
Almas-Ali commented 2 months ago

Well your right it is not belongs to this PR.

It is a separated issue. #118

angelcaru commented 2 months ago

But I don't get how this is an issue at all. If you leak data it's YOUR FAULT. Not the LANGUAGE's

Almas-Ali commented 2 months ago

But I don't get how this is an issue at all. If you leak data it's YOUR FAULT. Not the LANGUAGE's

I will put some examples after testing. I was getting some errors where if I had some issue with HashMap and Array. So, it was displaying whole data in the console.

The security issue here is, when you will use a debugger and use real-time important data (from database or remote server) if something goes wrong, it will display everything to a tester or maintenance team. It can contain credit card info, usernames, bank details, passwords/pin etc. anything.