@@ -62,9 +62,9 @@ _crypt_gensalt_extended_rn(unsigned long count,
6262 output [2 ] = _crypt_itoa64 [(count >> 6 ) & 0x3f ];
6363 output [3 ] = _crypt_itoa64 [(count >> 12 ) & 0x3f ];
6464 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 );
6868 output [5 ] = _crypt_itoa64 [value & 0x3f ];
6969 output [6 ] = _crypt_itoa64 [(value >> 6 ) & 0x3f ];
7070 output [7 ] = _crypt_itoa64 [(value >> 12 ) & 0x3f ];
@@ -90,9 +90,9 @@ _crypt_gensalt_md5_rn(unsigned long count,
9090 output [0 ] = '$' ;
9191 output [1 ] = '1' ;
9292 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 );
9696 output [3 ] = _crypt_itoa64 [value & 0x3f ];
9797 output [4 ] = _crypt_itoa64 [(value >> 6 ) & 0x3f ];
9898 output [5 ] = _crypt_itoa64 [(value >> 12 ) & 0x3f ];
@@ -101,9 +101,9 @@ _crypt_gensalt_md5_rn(unsigned long count,
101101
102102 if (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 );
107107 output [7 ] = _crypt_itoa64 [value & 0x3f ];
108108 output [8 ] = _crypt_itoa64 [(value >> 6 ) & 0x3f ];
109109 output [9 ] = _crypt_itoa64 [(value >> 12 ) & 0x3f ];
0 commit comments