summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--execute.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/execute.c b/execute.c
index 6c8e0d4..8cdbd70 100644
--- a/execute.c
+++ b/execute.c
@@ -1426,21 +1426,23 @@ static php_uint32 suhosin_rand(TSRMLS_D)
1426 1426
1427static int ih_srand(IH_HANDLER_PARAMS) 1427static int ih_srand(IH_HANDLER_PARAMS)
1428{ 1428{
1429 int argc = ZEND_NUM_ARGS(); 1429 int argc = ZEND_NUM_ARGS();
1430 long seed; 1430 long seed;
1431 1431
1432 if (zend_parse_parameters(argc TSRMLS_CC, "|l", &seed) == FAILURE || SUHOSIN_G(srand_ignore)) { 1432 if (SUHOSIN_G(srand_ignore)) {
1433 if (SUHOSIN_G(srand_ignore)) { 1433 SUHOSIN_G(r_is_seeded) = 0;
1434 SUHOSIN_G(r_is_seeded) = 0; 1434 return 1;
1435 } 1435 }
1436 return (1); 1436
1437 } 1437 if (zend_parse_parameters(argc TSRMLS_CC, "|l", &seed) == FAILURE) {
1438 return 1;
1439 }
1438 1440
1439 if (argc == 0) { 1441 if (argc) {
1440 suhosin_srand_auto(TSRMLS_C); 1442 suhosin_srand(seed TSRMLS_CC);
1441 } else { 1443 } else {
1442 suhosin_srand(seed TSRMLS_CC); 1444 suhosin_srand_auto(TSRMLS_C);
1443 } 1445 }
1444 return (1); 1446 return (1);
1445} 1447}
1446 1448