Skip to content

Buffer overflow in date package

2 messages · Erik Doffagne, Brian Ripley

#
On 20/11/2012 06:49, Erik Doffagne wrote:
You need to report this to the package maintainer (see the posting 
guide).  But running under valgrind shows why this is not reproducible:

==1487== Conditional jump or move depends on uninitialised value(s)
==1487==    at 0x4B9215: Rf_mkChar (envir.c:3380)
==1487==    by 0x49C471: do_dotCode (dotcode.c:2497)
==1487==    by 0x4C0ABD: Rf_eval (eval.c:494)
==1487==    by 0x4C4258: do_set (eval.c:1717)
==1487==    by 0x4C08DA: Rf_eval (eval.c:468)
==1487==    by 0x4C345F: do_begin (eval.c:1415)
==1487==    by 0x4C08DA: Rf_eval (eval.c:468)
==1487==    by 0x4C26D3: do_if (eval.c:1194)
==1487==    by 0x4C08DA: Rf_eval (eval.c:468)
==1487==    by 0x4C26D3: do_if (eval.c:1194)
==1487==    by 0x4C08DA: Rf_eval (eval.c:468)
==1487==    by 0x4C345F: do_begin (eval.c:1415)
==1487==  Uninitialised value was created by a heap allocation
==1487==    at 0x4A0762F: malloc (vg_replace_malloc.c:270)
==1487==    by 0x4F71CE: GetNewPage (memory.c:787)
==1487==    by 0x504851: Rf_allocVector (memory.c:2371)
==1487==    by 0x552FC3: ReadItem (serialize.c:1633)
==1487==    by 0x5536FD: ReadBC1 (serialize.c:1782)
==1487==    by 0x55361D: ReadBCConsts (serialize.c:1758)
==1487==    by 0x55374C: ReadBC1 (serialize.c:1784)
==1487==    by 0x5537D6: ReadBC (serialize.c:1794)
==1487==    by 0x5531B3: ReadItem (serialize.c:1660)
==1487==    by 0x552AD2: ReadItem (serialize.c:1571)
==1487==    by 0x5539A0: R_Unserialize (serialize.c:1837)
==1487==    by 0x5552E0: R_unserialize (serialize.c:2456)
==1487==
[1] <NA>
This fails to terminate cdate, and the C code does do strlen() on it.