Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a possible NULL-pointer dereference in the "fossil search" command.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:5dc60b1faffeeb68c74d1fc92400f6568204d371
User & Date: drh 2014-01-09 20:59:07
Context
2014-01-09
21:10
Add -width option to the search command. check-in: e4a6159b user: mistachkin tags: trunk
21:00
Fix a possible NULL-pointer dereference in the "fossil search" command. check-in: 6e7e8fbe user: drh tags: branch-1.28
20:59
Fix a possible NULL-pointer dereference in the "fossil search" command. check-in: 5dc60b1f user: drh tags: trunk
20:20
Avoid initializing TH1 for running hooks when not strictly necessary. check-in: e252c944 user: mistachkin tags: trunk
Changes

Changes to src/search.c.

104
105
106
107
108
109
110

111
112
113
114
115
116
117
  int iPrev = 999;
  int score = 10;
  int iBonus = 0;
  int i, j;
  unsigned char seen[8];

  memset(seen, 0, sizeof(seen));

  for(i=0; zDoc[i]; i++){
    char c = zDoc[i];
    if( isBoundary[c&0xff] ) continue;
    for(j=0; j<p->nTerm; j++){
      int n = p->a[j].n;
      if( sqlite3_strnicmp(p->a[j].z, &zDoc[i], n)==0 ){
        score += 1;







>







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
  int iPrev = 999;
  int score = 10;
  int iBonus = 0;
  int i, j;
  unsigned char seen[8];

  memset(seen, 0, sizeof(seen));
  if( zDoc==0 ) return score;
  for(i=0; zDoc[i]; i++){
    char c = zDoc[i];
    if( isBoundary[c&0xff] ) continue;
    for(j=0; j<p->nTerm; j++){
      int n = p->a[j].n;
      if( sqlite3_strnicmp(p->a[j].z, &zDoc[i], n)==0 ){
        score += 1;