]> git.ipfire.org Git - thirdparty/git.git/blobdiff - compat/qsort.c
use st_add and st_mult for allocation size computation
[thirdparty/git.git] / compat / qsort.c
index 9574d537bd38d3aa72ee040b106456088ee16a07..7d071afb70530ede222ed9cdb4645baf4277fb79 100644 (file)
@@ -47,7 +47,7 @@ static void msort_with_tmp(void *b, size_t n, size_t s,
 void git_qsort(void *b, size_t n, size_t s,
               int (*cmp)(const void *, const void *))
 {
-       const size_t size = n * s;
+       const size_t size = st_mult(n, s);
        char buf[1024];
 
        if (size < sizeof(buf)) {