Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at var-expand.c:152

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

passwd_file_lookup

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/userdb-passwd-file.c)expand/collapse
Show more  
 22  static void passwd_file_lookup(struct auth_request *auth_request,
 23                                 userdb_callback_t *callback)
 24  {
 25          struct userdb_module *_module = auth_request->userdb->userdb;
 26          struct passwd_file_userdb_module *module =
 27                  (struct passwd_file_userdb_module *)_module;
 28          struct passwd_user *pu;
 29          const struct var_expand_table *table;
 30          string_t *str;
 31          const char *key, *value;
 32          char **p;
 33   
 34[+]         pu = db_passwd_file_lookup(module->pwf, auth_request);
 35          if (pu == NULL) {
 36                  callback(USERDB_RESULT_USER_UNKNOWN, auth_request);
 37                  return;
 38          }
 39   
 40          auth_request_init_userdb_reply(auth_request);
 41          if (pu->uid != (uid_t)-1) {
 42                  auth_request_set_userdb_field(auth_request, "uid",
 43                                                dec2str(pu->uid));
 44          }
 45          if (pu->gid != (gid_t)-1) {
 46                  auth_request_set_userdb_field(auth_request, "gid",
 47                                                dec2str(pu->gid));
 48          }
 49   
 50          if (pu->home != NULL)
 51                  auth_request_set_userdb_field(auth_request, "home", pu->home);
 52   
 53          if (pu->extra_fields != NULL) {
 54                  str = t_str_new(512);
 55                  table = auth_request_get_var_expand_table(auth_request, NULL);
 56   
 57                  for (p = pu->extra_fields; *p != NULL; p++) {
 58                          if (strncmp(*p, "userdb_", 7) != 0)
 59                                  continue;
 60   
 61                          key = *p + 7;
 62                          value = strchr(key, '=');
 63                          if (value != NULL) {
 64                                  key = t_strdup_until(key, value);
 65                                  str_truncate(str, 0);
 66                                  var_expand(str, value + 1, table);
 67                                  value = str_c(str);
 68                          }
 69[+]                         auth_request_set_userdb_field(auth_request, key, value);
expand/collapse

auth_request_set_userdb_field

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/auth-request.c)expand/collapse
Show more  
 1147  void auth_request_set_userdb_field(struct auth_request *request,
 1148                                     const char *name, const char *value)
 1149  {
 1150          uid_t uid;
 1151          gid_t gid;
 1152   
 1153          if (strcmp(name, "uid") == 0) {
 1154                  uid = userdb_parse_uid(request, value);
 1155                  if (uid == (uid_t)-1) {
 1156                          request->userdb_lookup_failed = TRUE;
 1157                          return;
 1158                  }
 1159                  value = dec2str(uid);
 1160          } else if (strcmp(name, "gid") == 0) {
 1161                  gid = userdb_parse_gid(request, value);
 1162                  if (gid == (gid_t)-1) {
 1163                          request->userdb_lookup_failed = TRUE;
 1164                          return;
 1165                  }
 1166                  value = dec2str(gid);
 1167          } else if (strcmp(name, "user") == 0) {
 1168                  auth_request_change_userdb_user(request, value);
 1169                  return;
 1170          } else if (strcmp(name, "uidgid_file") == 0) {
 1171[+]                 auth_request_set_uidgid_file(request, value);
expand/collapse

auth_request_set_uidgid_file

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/auth-request.c)expand/collapse
Show more  
 1127  static void auth_request_set_uidgid_file(struct auth_request *request,
 1128                                           const char *path_template)
 1129  {
 1130          string_t *path;
 1131          struct stat st;
 1132   
 1133          path = t_str_new(256);
 1134          var_expand(path, path_template,
 1135[+]                    auth_request_get_var_expand_table(request, NULL));
expand/collapse

var_expand

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/var-expand.c)expand/collapse
Show more  
 139  void var_expand(string_t *dest, const char *str,
 140                  const struct var_expand_table *table)
 141  {
 142          const struct var_expand_modifier *m;
 143          const struct var_expand_table *t;
 144          const char *var;
 145          struct var_expand_context ctx;
 146          const char *(*modifier[MAX_MODIFIER_COUNT])
 147                  (const char *, struct var_expand_context *);
 148          const char *end;
 149          unsigned int i, len, modifier_count;
 150   
 151          memset(&ctx, 0, sizeof(ctx));
 152          for (; *str != '\0'; str++) {
Show more  
Show more  
Show more  
Show more  




Change Warning 7711.25056 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: