@@ -62,9 +62,9 @@ _crypt_gensalt_extended_rn(unsigned long count,
62
62
output [2 ]= _crypt_itoa64 [(count >>6 )& 0x3f ];
63
63
output [3 ]= _crypt_itoa64 [(count >>12 )& 0x3f ];
64
64
output [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 );
68
68
output [5 ]= _crypt_itoa64 [value & 0x3f ];
69
69
output [6 ]= _crypt_itoa64 [(value >>6 )& 0x3f ];
70
70
output [7 ]= _crypt_itoa64 [(value >>12 )& 0x3f ];
@@ -90,9 +90,9 @@ _crypt_gensalt_md5_rn(unsigned long count,
90
90
output [0 ]= '$' ;
91
91
output [1 ]= '1' ;
92
92
output [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 );
96
96
output [3 ]= _crypt_itoa64 [value & 0x3f ];
97
97
output [4 ]= _crypt_itoa64 [(value >>6 )& 0x3f ];
98
98
output [5 ]= _crypt_itoa64 [(value >>12 )& 0x3f ];
@@ -101,9 +101,9 @@ _crypt_gensalt_md5_rn(unsigned long count,
101
101
102
102
if (size >=6 && output_size >=3 + 4 + 4 + 1 )
103
103
{
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 );
107
107
output [7 ]= _crypt_itoa64 [value & 0x3f ];
108
108
output [8 ]= _crypt_itoa64 [(value >>6 )& 0x3f ];
109
109
output [9 ]= _crypt_itoa64 [(value >>12 )& 0x3f ];