Prev: Kernel: 2.6.31.5: CE: hpet increasing min_delta_ns: What do these messages mean?
Next: [PATCH] pxa: make index mfp unsigned in mfp_read() and write()
From: André Goddard Rosa on 11 Nov 2009 10:10 Fix a rare overflow situation which can occur when working with large arrays. Also, remove an unneeded calculation. changelog: v4: fix the overflow which could still happen when the number of array elements to search approached the maximum value of size_t and to find the key element we would need to traverse the whole binary tree (making 'start' idx tend towards 'end' idx), as pointed by review feedback from Rusty Russell (thanks!) v3: fix the comment/example of patch 02/02 at v2 patch series v2: fix a bug introduced into 01/02 of the v1 patch series v1: initial submission André Goddard Rosa (2): bsearch: avoid unneeded decrement arithmetic bsearch: prevent overflow when computing middle comparison element lib/bsearch.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |