Showing error 1537

User: Jiri Slaby
Error type: Reachable Error Location
Error type description: A specified error location is reachable in some program path
File location: loops/veris.c_OpenSER__cases1_stripFullBoth_arr_safe.i
Line in file: 3
Project: SV-COMP 2013
Project version: 2.6.28
Tools: Manual Work
Entered: 2013-01-17 16:57:54 UTC


Source:

 1void __VERIFIER_assert(int cond) {
 2  if (!(cond)) {
 3    ERROR: goto ERROR;
 4  }
 5  return;
 6}
 7typedef int size_t;
 8typedef int bool;
 9char *strchr(const char *s, int c);
10char *strrchr(const char *s, int c);
11char *strstr(const char *haystack, const char *needle);
12char *strncpy (char *dest, const char *src, size_t n);
13char *strncpy_ptr (char *dest, const char *src, size_t n);
14char *strcpy (char *dest, const char *src);
15unsigned strlen(const char *s);
16int strncmp (const char *s1, const char *s2, size_t n);
17int strcmp (const char *s1, const char *s2);
18char *strcat(char *dest, const char *src);
19void *memcpy(void *dest, const void *src, size_t n);
20int isascii (int c);
21int isspace (int c);
22int getc ( );
23char *strrand (char *s);
24int istrrand (char *s);
25int istrchr(const char *s, int c);
26int istrrchr(const char *s, int c);
27int istrncmp (const char *s1, int start, const char *s2, size_t n);
28int istrstr(const char *haystack, const char *needle);
29char *r_strncpy (char *dest, const char *src, size_t n);
30char *r_strcpy (char *dest, const char *src);
31char *r_strcat(char *dest, const char *src);
32char *r_strncat(char *dest, const char *src, size_t n);
33void *r_memcpy(void *dest, const void *src, size_t n);
34typedef unsigned int u_int;
35typedef unsigned char u_int8_t;
36struct ieee80211_scan_entry {
37  u_int8_t *se_rsn_ie;
38};
39typedef int NSS_STATUS;
40typedef char fstring[2];
41struct sockaddr_un
42{
43  char sun_path[2 + 1];
44};
45static int parse_expression_list(char *str)
46{
47  int start=0, i=-1, j=-1;
48  char str2[2];
49  if (!str) return -1;
50  do {
51    i++;
52    switch(str[i]) {
53    case 0:
54      while ((str[start] == ' ') || (str[start] == '\t')) start++;
55      if (str[start] == '"') start++;
56      j = i-1;
57      while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--;
58      if ((0 < j) && (str[j] == '"')) j--;
59      if (start<=j) {
60        if (j-start+1>=2) {
61          return -1;
62        }
63        r_strncpy(str2, str+start, j-start+1);
64        str2[j-start+1] = 0;
65      } else {
66        return -1;
67      }
68      start = i+1;
69    }
70  } while (str[i] != 0);
71  return 0;
72}
73int main ()
74{
75  char A [2 + 2 + 4 +1];
76  A[2 + 2 + 4] = 0;
77  parse_expression_list (A);
78  return 0;
79}