@@ -62,9 +62,9 @@ _crypt_gensalt_extended_rn(unsigned long count,
6262output [2 ]= _crypt_itoa64 [(count >>6 )& 0x3f ];
6363output [3 ]= _crypt_itoa64 [(count >>12 )& 0x3f ];
6464output [4 ]= _crypt_itoa64 [(count >>18 )& 0x3f ];
65- value = (unsigned long )input [0 ] |
66- ((unsigned long )input [1 ] <<8 ) |
67- ((unsigned long )input [2 ] <<16 );
65+ value = (unsigned long )( unsigned char ) input [0 ] |
66+ ((unsigned long )( unsigned char ) input [1 ] <<8 ) |
67+ ((unsigned long )( unsigned char ) input [2 ] <<16 );
6868output [5 ]= _crypt_itoa64 [value & 0x3f ];
6969output [6 ]= _crypt_itoa64 [(value >>6 )& 0x3f ];
7070output [7 ]= _crypt_itoa64 [(value >>12 )& 0x3f ];
@@ -90,9 +90,9 @@ _crypt_gensalt_md5_rn(unsigned long count,
9090output [0 ]= '$' ;
9191output [1 ]= '1' ;
9292output [2 ]= '$' ;
93- value = (unsigned long )input [0 ] |
94- ((unsigned long )input [1 ] <<8 ) |
95- ((unsigned long )input [2 ] <<16 );
93+ value = (unsigned long )( unsigned char ) input [0 ] |
94+ ((unsigned long )( unsigned char ) input [1 ] <<8 ) |
95+ ((unsigned long )( unsigned char ) input [2 ] <<16 );
9696output [3 ]= _crypt_itoa64 [value & 0x3f ];
9797output [4 ]= _crypt_itoa64 [(value >>6 )& 0x3f ];
9898output [5 ]= _crypt_itoa64 [(value >>12 )& 0x3f ];
@@ -101,9 +101,9 @@ _crypt_gensalt_md5_rn(unsigned long count,
101101
102102if (size >=6 && output_size >=3 + 4 + 4 + 1 )
103103{
104- value = (unsigned long )input [3 ] |
105- ((unsigned long )input [4 ] <<8 ) |
106- ((unsigned long )input [5 ] <<16 );
104+ value = (unsigned long )( unsigned char ) input [3 ] |
105+ ((unsigned long )( unsigned char ) input [4 ] <<8 ) |
106+ ((unsigned long )( unsigned char ) input [5 ] <<16 );
107107output [7 ]= _crypt_itoa64 [value & 0x3f ];
108108output [8 ]= _crypt_itoa64 [(value >>6 )& 0x3f ];
109109output [9 ]= _crypt_itoa64 [(value >>12 )& 0x3f ];