diff -ur xsel-1.2.0/xsel.c xsel-1.2.0.new/xsel.c --- xsel-1.2.0/xsel.c 2008-02-12 05:50:18.000000000 +0100 +++ xsel-1.2.0.new/xsel.c 2011-03-23 16:38:38.942688972 +0100 @@ -68,7 +68,7 @@ * NB. We do not currently serve COMPOUND_TEXT; we can retrieve it but do not * perform charset conversion. */ -#define MAX_NUM_TARGETS 8 +#define MAX_NUM_TARGETS 9 static int NUM_TARGETS; static Atom supported_targets[MAX_NUM_TARGETS]; @@ -2097,6 +2097,11 @@ supported_targets[s++] = XA_STRING; NUM_TARGETS++; + if (NUM_TARGETS > MAX_NUM_TARGETS) { + exit_err ("internal error num-targets (%d) > max-num-targets (%d)\n", + NUM_TARGETS, MAX_NUM_TARGETS); + } + /* Get the COMPOUND_TEXT atom. * NB. We do not currently serve COMPOUND_TEXT; we can retrieve it but * do not perform charset conversion.