Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at message-header-decode.c:69

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

message_header_decode

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-mail/message-header-decode.c)expand/collapse
Show more  
 59  void message_header_decode(const unsigned char *data, size_t size,
 60                             message_header_decode_callback_t *callback,
 61                             void *context)
 62  {
 63          buffer_t *decodebuf = NULL;
 64          unsigned int charsetlen = 0;
 65          size_t pos, start_pos, ret;
 66   
 67          /* =?charset?Q|B?text?= */
 68          start_pos = pos = 0;
 69          for (pos = 0; pos + 1 < size; ) {
 70                  if (data[pos] != '=' || data[pos+1] != '?') {
 71                          pos++;
 72                          continue;
 73                  }
 74   
 75                  /* encoded string beginning */
 76                  if (pos != start_pos) {
 77                          /* send the unencoded data so far */
 78                          if (!callback(data + start_pos, pos - start_pos,
 79                                        NULL, context)) {
 80                                  start_pos = size;
 81                                  break;
 82                          }
 83                  }
 84   
 85                  if (decodebuf == NULL) {
 86                          decodebuf = buffer_create_dynamic(default_pool,
 87                                                            size - pos);
 88                  } else {
 89                          buffer_set_used_size(decodebuf, 0);
 90                  }
 91   
 92                  pos += 2;
 93                  ret = message_header_decode_encoded(data + pos, size - pos,
 94                                                      decodebuf, &charsetlen);
 95                  if (ret == 0) {
 96                          start_pos = pos-2;
 97                          continue;
 98                  }
 99                  pos += ret;
 100   
 101                  if (decodebuf->used > charsetlen) {
 102                          /* decodebuf contains <charset> NUL <text> */
 103                          if (!callback(CONST_PTR_OFFSET(decodebuf->data,
 104                                                         charsetlen),
 105                                        decodebuf->used - charsetlen,
 106                                        decodebuf->data, context)) {
 107                                  start_pos = size;
 108                                  break;
 109                          }
 110                  }
 111   
 112                  start_pos = pos;
 113          }
 114   
 115          if (size != start_pos) {
 116                  (void)callback(data + start_pos, size - start_pos,
 117                                 NULL, context);
 118          }
 119          if (decodebuf != NULL)
 120                  buffer_free(&decodebuf);
 121  }
Show more  




Change Warning 7161.24623 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: