Hi all,

I've come across the observation that KLEE doesn't properly handle the return 
of statically allocated memory regions returned by calls to external functions 
- any usage of the pointers ends up in "memory error: out of bound pointer". 
For example, in the program included at the bottom, the usage of the "tm" 
variable triggers this.

I wanted to ask if this is a well-known "issue" and whether there are any 
workarounds (apart from re-implementing the functions using the _r variants 
where available).

Many thanks,
Milen

#include <time.h>
#include <stdio.h>
 
int main(int argc, char* argv[]) {
  time_t now = time(NULL);
  struct tm* tm = gmtime(&now);
  if(tm)
    printf("year=%d, month=%d, day=%d\n", tm->tm_year, tm->tm_mon, tm->tm_mday);
  return 0;
}

Reply via email to