Guys,

   There seems to be a bug in function get_random_bytes(). I reported this 
earlier as well but somehow it didn't appear here.

get_random_bytes(unsigned char *data, unsigned int length)
{

long r;
        unsigned n;
int fd;

fd = open("/dev/urandom", O_RDONLY);
        while (length > 0) {

if (!fd || read(fd, &r, sizeof(long)) != -1)      <<<< the condition is 
incorrect

The correct check should be 
                if (fd == -1 || read(fd, &r, sizeof(long)) == -1)


Can someone take a look ?

thanks.





-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/open-iscsi/-/xELBI4_f2fcJ.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to