iota(-5) produces negative shape vector!
Bugzilla Link | 1190 |
Created on | Apr 07, 2017 14:35 |
Version | svn |
OS | Linux |
Architecture | PC |
Attachments | bugiota.sac |
Extended Description
Created an attachment (id=1060) source code to reproduce failure The Stdlib version of iota, as well as the sac2c runtime code, are rather cavalier about their treatment of shape vectors. The attached function generates an array with a negative element in its shape vector. This is a bad idea for several reasons. Security is just one of those reasons. I am not sure of the best way to address this fault. From the standpoint of iota(N), we could do: max(N,0), which would give an empty array for negative N. Or, we could signal an error, which might be a better idea. The fact that we can even generate an array with a negative element in its shape vector is very scary. We should address that problem, as it opens the door to a whole world of security and integrity faults.