mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
Fix an empty arrays condition and optimize a bit.
@ Fixed a crash in array_multisort() that happened when empty arrays @ were passed to it. (Andrei)
This commit is contained in:
parent
ddc36fb776
commit
105be1513d
@ -2152,6 +2152,15 @@ PHP_FUNCTION(array_multisort)
|
||||
}
|
||||
}
|
||||
|
||||
/* If all arrays are empty or have only one entry,
|
||||
we don't need to do anything. */
|
||||
if (array_size < 1) {
|
||||
efree(ARRAYG(multisort_flags));
|
||||
efree(arrays);
|
||||
efree(args);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
/* Create the indirection array. This array is of size MxN, where
|
||||
M is the number of entries in each input array and N is the number
|
||||
of the input arrays + 1. The last column is NULL to indicate the end
|
||||
|
Loading…
Reference in New Issue
Block a user