SHA256
1
0
forked from pool/coreutils
coreutils/coreutils-8.9-singlethreaded-sort.patch
Bernhard Voelker 94e801cf55 - Avoid segmentation fault in "join -i" with long line input (bnc#798541, VUL-1)
* src/join.c: Instead of usig unreliable alloca() stack allocation,
    use heap allocation via xmalloc()+free().
    (coreutils-i18n.patch, from Philipp Thomas <pth@suse.de>)
- Avoid segmentation fault in "sort -d" and "sort -M" with long line input
  (bnc#798538, VUL-1)
  * src/sort.c: Instead of usig unreliable alloca() stack allocation,
    use heap allocation via xmalloc()+free().
    (coreutils-i18n.patch, from Philipp Thomas <pth@suse.de>)

OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=173
2013-01-17 16:45:17 +00:00

18 lines
531 B
Diff

Index: src/sort.c
===================================================================
--- src/sort.c.orig
+++ src/sort.c
@@ -5291,7 +5291,11 @@ main (int argc, char **argv)
{
if (!nthreads)
{
- unsigned long int np = num_processors (NPROC_CURRENT_OVERRIDABLE);
+ unsigned long int np;
+ if (getenv("OMP_NUM_THREADS"))
+ np = num_processors (NPROC_CURRENT_OVERRIDABLE);
+ else
+ np = 1;
nthreads = MIN (np, DEFAULT_MAX_THREADS);
}