Coverity-updates archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

New Defects reported by Coverity Scan for NetBSD-amd64-user



Hi,


Please find the latest report on new defect(s) introduced to NetBSD found with 
Coverity Scan.

Defect(s) Reported-by: Coverity Scan
Showing 20 of 29 defect(s)


** CID 976662:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kcm/client.c: 73 in 
kcm_ccache_destroy_client()

** CID 976663:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kcm/client.c: 130 in kcm_ccache_new_client()

** CID 976664:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kcm/client.c: 49 in 
kcm_ccache_resolve_client()

** CID 976665:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kcm/events.c: 418 in kcm_run_events()

** CID 976666:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kcm/renew.c: 95 in kcm_ccache_refresh()

** CID 745375:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/lib/hx509/hxtool.c: 1374 in request_print()

** CID 976708:  Improper use of negative value  (NEGATIVE_RETURNS)
/external/bsd/top/dist/commands.c: 206 in err_string()

** CID 976766:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/fs/hfs/t_pathconvert.c: 45 in atfu_colonslash_body()
/tests/fs/hfs/t_pathconvert.c: 48 in atfu_colonslash_body()

** CID 976790:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/lib/libpthread/t_swapcontext.c: 100 in atfu_swapcontext1_body()

** CID 976791:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/lib/libpthread/t_swapcontext.c: 78 in threadfunc()

** CID 976792:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/lib/librumpclient/t_fd.c: 69 in atfu_bigenough_body()

** CID 976793:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/lib/librumpclient/t_fd.c: 112 in atfu_sigio_body()

** CID 976794:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/libexec/ld.elf_so/t_dlinfo.c: 100 in 
atfu_rtld_dlinfo_linkmap_dlopen_iter_body()

** CID 976807:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkcsmapper/yacc.y: 670 in do_mkpv()

** CID 976808:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkcsmapper/yacc.y: 373 in dump_file()
/usr.bin/mkesdb/yacc.y: 168 in dump_file()
/usr.bin/mkesdb/yacc.y: 173 in dump_file()
/usr.bin/mkesdb/yacc.y: 189 in dump_file()

** CID 976809:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkcsmapper/yacc.y: 379 in dump_file()
/usr.bin/mkcsmapper/yacc.y: 384 in dump_file()
/usr.bin/mkcsmapper/yacc.y: 389 in dump_file()

** CID 976810:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkcsmapper/yacc.y: 409 in dump_file()
/usr.bin/mkesdb/yacc.y: 214 in dump_file()

** CID 976812:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkesdb/yacc.y: 287 in do_mkdb()

** CID 976813:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkesdb/yacc.y: 164 in dump_file()
/usr.bin/mkesdb/yacc.y: 178 in dump_file()
/usr.bin/mkesdb/yacc.y: 183 in dump_file()
/usr.bin/mkesdb/yacc.y: 193 in dump_file()

** CID 976816:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/passwd/krb5_passwd.c: 139 in pwkrb5_process()


________________________________________________________________________________________________________
*** CID 976662:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kcm/client.c: 73 in 
kcm_ccache_destroy_client()
67                        kcm_client *client,
68                        const char *name)
69     {
70         krb5_error_code ret;
71         kcm_ccache ccache;
72     
>>>     CID 976662:  Improper use of negative value  (NEGATIVE_RETURNS)
>>>     Assigning: signed variable "ret" = "kcm_ccache_resolve(krb5_context, 
>>> char const *, kcm_ccache *)".
73         ret = kcm_ccache_resolve(context, name, &ccache);
74         if (ret) {
75      kcm_log(1, "Failed to resolve cache %s: %s",
76              name, krb5_get_err_text(context, ret));
77      return ret;
78         }

________________________________________________________________________________________________________
*** CID 976663:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kcm/client.c: 130 in kcm_ccache_new_client()
124                 return KRB5_FCC_PERM;
125         } else if (ret != KRB5_FCC_NOFILE && !(CLIENT_IS_ROOT(client) && 
ret == KRB5_FCC_PERM)) {
126                     return ret;
127         }
128     
129         if (ret == KRB5_FCC_NOFILE) {
>>>     CID 976663:  Improper use of negative value  (NEGATIVE_RETURNS)
>>>     Assigning: signed variable "ret" = "kcm_ccache_new(krb5_context, char 
>>> const *, kcm_ccache *)".
130             ret = kcm_ccache_new(context, name, &ccache);
131             if (ret) {
132                 kcm_log(1, "Failed to initialize cache %s: %s",
133                         name, krb5_get_err_text(context, ret));
134                 return ret;
135             }

________________________________________________________________________________________________________
*** CID 976664:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kcm/client.c: 49 in 
kcm_ccache_resolve_client()
43                        kcm_operation opcode,
44                        const char *name,
45                        kcm_ccache *ccache)
46     {
47         krb5_error_code ret;
48     
>>>     CID 976664:  Improper use of negative value  (NEGATIVE_RETURNS)
>>>     Assigning: signed variable "ret" = "kcm_ccache_resolve(krb5_context, 
>>> char const *, kcm_ccache *)".
49         ret = kcm_ccache_resolve(context, name, ccache);
50         if (ret) {
51      kcm_log(1, "Failed to resolve cache %s: %s",
52              name, krb5_get_err_text(context, ret));
53      return ret;
54         }

________________________________________________________________________________________________________
*** CID 976665:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kcm/events.c: 418 in kcm_run_events()
412         /* go through events list, fire and expire */
413         for (e = &events_head; *e != NULL; e = &(*e)->next) {
414             if ((*e)->valid == 0)
415                 continue;
416     
417             if (now >= (*e)->fire_time) {
>>>     CID 976665:  Improper use of negative value  (NEGATIVE_RETURNS)
>>>     Assigning: signed variable "ret" = "kcm_fire_event(krb5_context, 
>>> kcm_event **)".
418                 ret = kcm_fire_event(context, e);
419                 if (ret) {
420                     kcm_log(1, "Could not fire event for cache %s: %s",
421                             (*e)->ccache->name, krb5_get_err_text(context, 
ret));
422                 }
423             } else if ((*e)->expire_time && now >= (*e)->expire_time) {

________________________________________________________________________________________________________
*** CID 976666:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kcm/renew.c: 95 in kcm_ccache_refresh()
89      in.times.renew_till = time(NULL) + ccache->renew_life;
90     
91         flags.i = 0;
92         flags.b.renewable = TRUE;
93         flags.b.renew = TRUE;
94     
>>>     CID 976666:  Improper use of negative value  (NEGATIVE_RETURNS)
>>>     Assigning: signed variable "ret" = "krb5_get_kdc_cred(krb5_context, 
>>> krb5_ccache, krb5_kdc_flags, krb5_addresses *, Ticket *, krb5_creds *, 
>>> krb5_creds **)".
95         ret = krb5_get_kdc_cred(context,
96                          &ccdata,
97                          flags,
98                          NULL,
99                          NULL,
100                                 &in,

________________________________________________________________________________________________________
*** CID 745375:  Improper use of negative value  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/lib/hx509/hxtool.c: 1374 in request_print()
1368            hx509_request req;
1369     
1370            ret = _hx509_request_parse(context, argv[i], &req);
1371            if (ret)
1372                hx509_err(context, 1, ret, "parse_request: %s", argv[i]);
1373     
>>>     CID 745375:  Improper use of negative value  (NEGATIVE_RETURNS)
>>>     Assigning: signed variable "ret" = "_hx509_request_print(hx509_context, 
>>> hx509_request, FILE *)".
1374            ret = _hx509_request_print(context, req, stdout);
1375            hx509_request_free(&req);
1376            if (ret)
1377                hx509_err(context, 1, ret, "Failed to print file %s", 
argv[i]);
1378         }
1379     

________________________________________________________________________________________________________
*** CID 976708:  Improper use of negative value  (NEGATIVE_RETURNS)
/external/bsd/top/dist/commands.c: 206 in err_string()
200     err_string(void)
201     
202     {
203         register struct errs *errp;
204         register int  cnt = 0;
205         register int  first = Yes;
>>>     CID 976708:  Improper use of negative value  (NEGATIVE_RETURNS)
>>>     Assigning: "currerr" = a negative value.
206         register int  currerr = -1;
207         int stringlen = 0;          /* characters still available in 
"string" */
208         char string[STRMAX];
209     
210         /* if there are no errors, our job is easy */
211         if (errcnt == 0)

________________________________________________________________________________________________________
*** CID 976766:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/fs/hfs/t_pathconvert.c: 45 in atfu_colonslash_body()
39      struct dirent *dirent;
40      int offset, nbytes;
41      bool ok = false;
42     
43      snprintf(thecmd, sizeof(thecmd), "uudecode %s/colon.hfs.bz2.uue",
44          atf_tc_get_config_var(tc, "srcdir"));
>>>     CID 976766:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "RZ_rv" is passed to a parameter that cannot be negative.
45      RZ(system(thecmd));
46     
47      snprintf(thecmd, sizeof(thecmd), "bunzip2 " IMGNAME ".bz2");
48      RZ(system(thecmd));
49     
50      memset(&args, 0, sizeof args);
/tests/fs/hfs/t_pathconvert.c: 48 in atfu_colonslash_body()
42     
43      snprintf(thecmd, sizeof(thecmd), "uudecode %s/colon.hfs.bz2.uue",
44          atf_tc_get_config_var(tc, "srcdir"));
45      RZ(system(thecmd));
46     
47      snprintf(thecmd, sizeof(thecmd), "bunzip2 " IMGNAME ".bz2");
>>>     CID 976766:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "RZ_rv" is passed to a parameter that cannot be negative.
48      RZ(system(thecmd));
49     
50      memset(&args, 0, sizeof args);
51      args.fspec = __UNCONST(FAKEBLK);
52      RZ(rump_init());
53     

________________________________________________________________________________________________________
*** CID 976790:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/lib/libpthread/t_swapcontext.c: 100 in atfu_swapcontext1_body()
94     
95      oself = (void *)&val1;
96      nself = (void *)&val2;
97     
98      printf("Testing if swapcontext() alters pthread_self()\n");
99     
>>>     CID 976790:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
100             PTHREAD_REQUIRE(getcontext(&nctx));
101             PTHREAD_REQUIRE(pthread_create(&thread, NULL, threadfunc, 
NULL));
102             
103             return;
104     }
105     

________________________________________________________________________________________________________
*** CID 976791:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/lib/libpthread/t_swapcontext.c: 78 in threadfunc()
72      nctx.uc_stack.ss_size = sizeof(stack);
73            
74      makecontext(&nctx, (void *)*swapfunc, 0);
75            
76      oself = (void *)pthread_self();
77      printf("before swapcontext self = %p\n", oself);
>>>     CID 976791:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
78      PTHREAD_REQUIRE(swapcontext(&octx, &nctx));
79     
80      /* NOTREACHED */
81      return NULL;
82     }
83     

________________________________________________________________________________________________________
*** CID 976792:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/lib/librumpclient/t_fd.c: 69 in atfu_bigenough_body()
63     ATF_TC_CLEANUP(sigio, tc) { system("env RUMP_SERVER=" RUMPSERV " 
rump.halt"); }
64     
65     ATF_TC_BODY(bigenough, tc)
66     {
67      struct stat sb;
68     
>>>     CID 976792:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "RZ_rv" is passed to a parameter that cannot be negative.
69      RZ(system("rump_server " RUMPSERV));
70      RL(setenv("RUMP_SERVER", RUMPSERV, 1));
71     
72      RL(dup2(0, 10));
73      RL(dup2(1, 11));
74      RL(dup2(2, 12));

________________________________________________________________________________________________________
*** CID 976793:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/lib/librumpclient/t_fd.c: 112 in atfu_sigio_body()
106             int ls;
107             int cs;
108             int fl;
109             int sc;
110     
111             signal(SIGIO, gotsig);
>>>     CID 976793:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "RZ_rv" is passed to a parameter that cannot be negative.
112             RZ(system("rump_server -lrumpnet -lrumpnet_net 
-lrumpnet_netinet "
113                 RUMPSERV));
114             RL(setenv("RUMP_SERVER", RUMPSERV, 1));
115     
116             RL(rumpclient_init());
117             RL(ls = rump_sys_socket(PF_INET, SOCK_STREAM, 0));

________________________________________________________________________________________________________
*** CID 976794:  Argument cannot be negative  (NEGATIVE_RETURNS)
/tests/libexec/ld.elf_so/t_dlinfo.c: 100 in 
atfu_rtld_dlinfo_linkmap_dlopen_iter_body()
94      struct link_map *map;
95      void *handle;
96     
97      handle = dlopen("libutil.so", RTLD_LAZY);
98      ATF_CHECK(handle);
99     
>>>     CID 976794:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "RZ_rv" is passed to a parameter that cannot be negative.
100             RZ(dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &map));
101     
102             for (; map->l_next; map = map->l_next)
103                     continue;
104             for (; map; map = map->l_prev)
105                     if (strstr(map->l_name, "libutil.so") != NULL)

________________________________________________________________________________________________________
*** CID 976807:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkcsmapper/yacc.y: 670 in do_mkpv()
664     
665             ret = _pivot_factory_convert(out, in);
666             fclose(out);
667             if (ret && output)
668                     unlink(output); /* dump failure */
669             if (ret)
>>>     CID 976807:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
670                     errx(EXIT_FAILURE, "%s\n", strerror(ret));
671     }
672     
673     __dead static void
674     usage(void)
675     {

________________________________________________________________________________________________________
*** CID 976808:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkcsmapper/yacc.y: 373 in dump_file()
367             /*
368              * build database
369              */
370             CHKERR(ret, _db_factory_create, (&df, _db_hash_std, NULL));
371     
372             /* store type */
>>>     CID 976808:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
373             CHKERR(ret, _db_factory_addstr_by_s,
374                    (df, _CITRUS_MAPPER_STD_SYM_TYPE,
375                     _CITRUS_MAPPER_STD_TYPE_ROWCOL));
376     
377             /* store info */
378             create_rowcol_info(&data);
/usr.bin/mkesdb/yacc.y: 168 in dump_file()
162     
163             /* store version */
164             CHKERR(ret, _db_factory_add32_by_s, (df, 
_CITRUS_ESDB_SYM_VERSION,
165                                                  _CITRUS_ESDB_VERSION));
166     
167             /* store encoding */
>>>     CID 976808:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
168             CHKERR(ret, _db_factory_addstr_by_s, (df, 
_CITRUS_ESDB_SYM_ENCODING,
169                                                   encoding));
170     
171             /* store variable */
172             if (variable)
173                     CHKERR(ret, _db_factory_addstr_by_s,
/usr.bin/mkesdb/yacc.y: 173 in dump_file()
167             /* store encoding */
168             CHKERR(ret, _db_factory_addstr_by_s, (df, 
_CITRUS_ESDB_SYM_ENCODING,
169                                                   encoding));
170     
171             /* store variable */
172             if (variable)
>>>     CID 976808:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
173                     CHKERR(ret, _db_factory_addstr_by_s,
174                            (df, _CITRUS_ESDB_SYM_VARIABLE, variable));
175     
176             /* store invalid */
177             if (use_invalid)
178                     CHKERR(ret, _db_factory_add32_by_s, (df,
/usr.bin/mkesdb/yacc.y: 189 in dump_file()
183             CHKERR(ret, _db_factory_add32_by_s, (df, 
_CITRUS_ESDB_SYM_NUM_CHARSETS,
184                                                  num_csids));
185             i=0;
186             SIMPLEQ_FOREACH(csid, &named_csids, ci_entry) {
187                     snprintf(buf, sizeof(buf), 
_CITRUS_ESDB_SYM_CSNAME_PREFIX "%d",
188                         i);
>>>     CID 976808:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
189                     CHKERR(ret, _db_factory_addstr_by_s,
190                            (df, buf, csid->ci_symbol));
191                     snprintf(buf, sizeof(buf), _CITRUS_ESDB_SYM_CSID_PREFIX 
"%d",
192                         i);
193                     CHKERR(ret, _db_factory_add32_by_s, (df, buf, 
csid->ci_csid));
194                     i++;

________________________________________________________________________________________________________
*** CID 976809:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkcsmapper/yacc.y: 379 in dump_file()
373             CHKERR(ret, _db_factory_addstr_by_s,
374                    (df, _CITRUS_MAPPER_STD_SYM_TYPE,
375                     _CITRUS_MAPPER_STD_TYPE_ROWCOL));
376     
377             /* store info */
378             create_rowcol_info(&data);
>>>     CID 976809:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
379             CHKERR(ret, _db_factory_add_by_s,
380                    (df, _CITRUS_MAPPER_STD_SYM_INFO, &data, 1));
381     
382             /* ilseq extension */
383             create_rowcol_ext_ilseq_info(&data);
384             CHKERR(ret, _db_factory_add_by_s,
/usr.bin/mkcsmapper/yacc.y: 384 in dump_file()
378             create_rowcol_info(&data);
379             CHKERR(ret, _db_factory_add_by_s,
380                    (df, _CITRUS_MAPPER_STD_SYM_INFO, &data, 1));
381     
382             /* ilseq extension */
383             create_rowcol_ext_ilseq_info(&data);
>>>     CID 976809:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
384             CHKERR(ret, _db_factory_add_by_s,
385                    (df, _CITRUS_MAPPER_STD_SYM_ROWCOL_EXT_ILSEQ, &data, 1));
386     
387             /* store table */
388             _region_init(&data, table, table_size*dst_unit_bits/8);
389             CHKERR(ret, _db_factory_add_by_s,
/usr.bin/mkcsmapper/yacc.y: 389 in dump_file()
383             create_rowcol_ext_ilseq_info(&data);
384             CHKERR(ret, _db_factory_add_by_s,
385                    (df, _CITRUS_MAPPER_STD_SYM_ROWCOL_EXT_ILSEQ, &data, 1));
386     
387             /* store table */
388             _region_init(&data, table, table_size*dst_unit_bits/8);
>>>     CID 976809:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
389             CHKERR(ret, _db_factory_add_by_s,
390                    (df, _CITRUS_MAPPER_STD_SYM_TABLE, &data, 1));
391     
392             /*
393              * dump database to file
394              */

________________________________________________________________________________________________________
*** CID 976810:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkcsmapper/yacc.y: 409 in dump_file()
403             }
404     
405             /* dump database body */
406             size = _db_factory_calc_size(df);
407             serialized = malloc(size);
408             _region_init(&data, serialized, size);
>>>     CID 976810:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
409             CHKERR(ret, _db_factory_serialize,
410                    (df, _CITRUS_MAPPER_STD_MAGIC, &data));
411             if (fwrite(serialized, size, 1, fp) != 1)
412                     err(EXIT_FAILURE, "fwrite");
413     
414             fclose(fp);
/usr.bin/mkesdb/yacc.y: 214 in dump_file()
208             }
209     
210             /* dump database body */
211             size = _db_factory_calc_size(df);
212             serialized = malloc(size);
213             _region_init(&data, serialized, size);
>>>     CID 976810:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
214             CHKERR(ret, _db_factory_serialize, (df, _CITRUS_ESDB_MAGIC, 
&data));
215             if (fwrite(serialized, size, 1, fp) != 1)
216                     err(EXIT_FAILURE, "fwrite");
217     
218             fclose(fp);
219     }

________________________________________________________________________________________________________
*** CID 976812:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkesdb/yacc.y: 287 in do_mkdb()
281     
282             ret = _lookup_factory_convert(out, in);
283             fclose(out);
284             if (ret && output)
285                     unlink(output); /* dump failure */
286             if (ret)
>>>     CID 976812:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
287                     errx(EXIT_FAILURE, "%s\n", strerror(ret));
288     }
289     
290     __dead static void
291     usage(void)
292     {

________________________________________________________________________________________________________
*** CID 976813:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/mkesdb/yacc.y: 164 in dump_file()
158             /*
159              * build database
160              */
161             CHKERR(ret, _db_factory_create, (&df, _db_hash_std, NULL));
162     
163             /* store version */
>>>     CID 976813:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
164             CHKERR(ret, _db_factory_add32_by_s, (df, 
_CITRUS_ESDB_SYM_VERSION,
165                                                  _CITRUS_ESDB_VERSION));
166     
167             /* store encoding */
168             CHKERR(ret, _db_factory_addstr_by_s, (df, 
_CITRUS_ESDB_SYM_ENCODING,
169                                                   encoding));
/usr.bin/mkesdb/yacc.y: 178 in dump_file()
172             if (variable)
173                     CHKERR(ret, _db_factory_addstr_by_s,
174                            (df, _CITRUS_ESDB_SYM_VARIABLE, variable));
175     
176             /* store invalid */
177             if (use_invalid)
>>>     CID 976813:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
178                     CHKERR(ret, _db_factory_add32_by_s, (df,
179                                                          
_CITRUS_ESDB_SYM_INVALID,
180                                                          invalid));
181     
182             /* store num of charsets */
183             CHKERR(ret, _db_factory_add32_by_s, (df, 
_CITRUS_ESDB_SYM_NUM_CHARSETS,
/usr.bin/mkesdb/yacc.y: 183 in dump_file()
177             if (use_invalid)
178                     CHKERR(ret, _db_factory_add32_by_s, (df,
179                                                          
_CITRUS_ESDB_SYM_INVALID,
180                                                          invalid));
181     
182             /* store num of charsets */
>>>     CID 976813:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
183             CHKERR(ret, _db_factory_add32_by_s, (df, 
_CITRUS_ESDB_SYM_NUM_CHARSETS,
184                                                  num_csids));
185             i=0;
186             SIMPLEQ_FOREACH(csid, &named_csids, ci_entry) {
187                     snprintf(buf, sizeof(buf), 
_CITRUS_ESDB_SYM_CSNAME_PREFIX "%d",
188                         i);
/usr.bin/mkesdb/yacc.y: 193 in dump_file()
187                     snprintf(buf, sizeof(buf), 
_CITRUS_ESDB_SYM_CSNAME_PREFIX "%d",
188                         i);
189                     CHKERR(ret, _db_factory_addstr_by_s,
190                            (df, buf, csid->ci_symbol));
191                     snprintf(buf, sizeof(buf), _CITRUS_ESDB_SYM_CSID_PREFIX 
"%d",
192                         i);
>>>     CID 976813:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
193                     CHKERR(ret, _db_factory_add32_by_s, (df, buf, 
csid->ci_csid));
194                     i++;
195             }
196     
197             /*
198              * dump database to file

________________________________________________________________________________________________________
*** CID 976816:  Argument cannot be negative  (NEGATIVE_RETURNS)
/usr.bin/passwd/krb5_passwd.c: 139 in pwkrb5_process()
133             }
134     
135             ret = krb5_init_context(&context);
136             if (ret != 0) {
137                     if (ret == ENXIO)
138                             errx(1, "Kerberos 5 not in use.");
>>>     CID 976816:  Argument cannot be negative  (NEGATIVE_RETURNS)
>>>     "ret" is passed to a parameter that cannot be negative.
139                     errx(1, "Unable to initialize Kerberos 5: %s", 
strerror(ret));
140             }
141     
142             ret = krb5_get_init_creds_opt_alloc(context, &opt);
143             if (ret) {
144                     pwkrb5_warn("failed to allocate opts", context, ret);


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, 
http://scan.coverity.com/projects/156?tab=Overview

To unsubscribe from the email notification for new defects, 
http://scan5.coverity.com/cgi-bin/unsubscribe.py




Home | Main Index | Thread Index | Old Index