@@ -277,18 +277,19 @@ PHP_METHOD(Random_Randomizer, getBytes)
277277 php_random_algo_with_state engine = randomizer -> engine ;
278278
279279 zend_string * retval ;
280- zend_long length ;
280+ zend_long user_length ;
281281 size_t total_size = 0 ;
282282
283283 ZEND_PARSE_PARAMETERS_START (1 , 1 )
284- Z_PARAM_LONG (length )
284+ Z_PARAM_LONG (user_length )
285285 ZEND_PARSE_PARAMETERS_END ();
286286
287- if (length < 1 ) {
287+ if (user_length < 1 ) {
288288 zend_argument_value_error (1 , "must be greater than 0" );
289289 RETURN_THROWS ();
290290 }
291291
292+ size_t length = (size_t )user_length ;
292293 retval = zend_string_alloc (length , 0 );
293294
294295 while (total_size < length ) {
@@ -385,13 +386,13 @@ PHP_METHOD(Random_Randomizer, getBytesFromString)
385386 php_random_randomizer * randomizer = Z_RANDOM_RANDOMIZER_P (ZEND_THIS );
386387 php_random_algo_with_state engine = randomizer -> engine ;
387388
388- zend_long length ;
389+ zend_long user_length ;
389390 zend_string * source , * retval ;
390391 size_t total_size = 0 ;
391392
392393 ZEND_PARSE_PARAMETERS_START (2 , 2 );
393394 Z_PARAM_STR (source )
394- Z_PARAM_LONG (length )
395+ Z_PARAM_LONG (user_length )
395396 ZEND_PARSE_PARAMETERS_END ();
396397
397398 const size_t source_length = ZSTR_LEN (source );
@@ -402,11 +403,12 @@ PHP_METHOD(Random_Randomizer, getBytesFromString)
402403 RETURN_THROWS ();
403404 }
404405
405- if (length < 1 ) {
406+ if (user_length < 1 ) {
406407 zend_argument_value_error (2 , "must be greater than 0" );
407408 RETURN_THROWS ();
408409 }
409410
411+ size_t length = (size_t )user_length ;
410412 retval = zend_string_alloc (length , 0 );
411413
412414 if (max_offset > 0xff ) {
0 commit comments