Skip to content
Prev 46203 / 63461 Next

missing PROTECT() in src/main/arithmetic.c

at lines 651 & 653 (integer_binary function):

     if (code == DIVOP || code == POWOP)
         ans = allocVector(REALSXP, n);
     else
         ans = allocVector(INTSXP, n);

There are calls to warningcall() later in the function, which can
trigger garbbage collection.

Looks like the typical scenario where it seemed pretty safe to not
PROTECT in the original version of the function but became very
unsafe 3 years later when the calls to warningcall() were added to
the function.

Cheers,
H.