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-amd64-user found with Coverity Scan.
16 new defect(s) introduced to NetBSD-amd64-user found with Coverity Scan.
8008 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 16 of 16 defect(s)
** CID 1428671: (NULL_RETURNS)
/usr/xsrc/external/mit/fontconfig/dist/src/fcmatch.c: 722 in FcFontSetMatchInternal()
/usr/xsrc/external/mit/fontconfig/dist/src/fcmatch.c: 723 in FcFontSetMatchInternal()
________________________________________________________________________________________________________
*** CID 1428671: (NULL_RETURNS)
/usr/xsrc/external/mit/fontconfig/dist/src/fcmatch.c: 722 in FcFontSetMatchInternal()
716 }
717 else
718 {
719 len = (p - s) + 1;
720 }
721 x = malloc (sizeof (char) * len);
>>> CID 1428671: (NULL_RETURNS)
>>> Dereferencing a pointer that might be null "x" when calling "strncpy".
722 strncpy (x, s, len - 1);
723 x[len - 1] = 0;
724 if (FcObjectFromName (x) > 0)
725 FcObjectSetAdd (os, x);
726 s = p + 1;
727 free (x);
/usr/xsrc/external/mit/fontconfig/dist/src/fcmatch.c: 723 in FcFontSetMatchInternal()
717 else
718 {
719 len = (p - s) + 1;
720 }
721 x = malloc (sizeof (char) * len);
722 strncpy (x, s, len - 1);
>>> CID 1428671: (NULL_RETURNS)
>>> Dereferencing a null pointer "x".
723 x[len - 1] = 0;
724 if (FcObjectFromName (x) > 0)
725 FcObjectSetAdd (os, x);
726 s = p + 1;
727 free (x);
728 }
** CID 1428670: Null pointer dereferences (NULL_RETURNS)
/usr/xsrc/external/mit/fontconfig/dist/src/fcstat.c: 221 in FcScandir()
________________________________________________________________________________________________________
*** CID 1428670: Null pointer dereferences (NULL_RETURNS)
/usr/xsrc/external/mit/fontconfig/dist/src/fcstat.c: 221 in FcScandir()
215 {
216 if (!filter || (filter) (dent))
217 {
218 size_t dentlen = FcPtrToOffset (dent, dent->d_name) + strlen (dent->d_name) + 1;
219 dentlen = ((dentlen + ALIGNOF_VOID_P - 1) & ~(ALIGNOF_VOID_P - 1));
220 p = (struct dirent *) malloc (dentlen);
>>> CID 1428670: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing a pointer that might be null "p" when calling "memcpy".
221 memcpy (p, dent, dentlen);
222 if ((n + 1) >= lsize)
223 {
224 lsize += 128;
225 dlp = (struct dirent **) realloc (dlist, sizeof (struct dirent *) * lsize);
226 if (!dlp)
** CID 1400640: Null pointer dereferences (NULL_RETURNS)
/usr/xsrc/external/mit/mkfontscale/dist/mkfontscale.c: 930 in doDirectory()
________________________________________________________________________________________________________
*** CID 1400640: Null pointer dereferences (NULL_RETURNS)
/usr/xsrc/external/mit/mkfontscale/dist/mkfontscale.c: 930 in doDirectory()
924 int n = strlen(xlfd_name);
925 if(reencodeLegacy &&
926 n >= 12 && strcasecmp(xlfd_name + n - 11, "-iso10646-1") == 0) {
927 char *s;
928
929 s = malloc(n - 10);
>>> CID 1400640: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing a pointer that might be null "s" when calling "memcpy".
930 memcpy(s, xlfd_name, n - 11);
931 s[n - 11] = '\0';
932 xlfd = listCons(s, xlfd);
933 } else {
934 /* Not a reencodable font -- skip all the rest of the loop body */
935 putHash(entries, xlfd_name, entry->d_name, PRIO(filePrio(entry->d_name)));
** CID 1286935: (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 193 in require2(int, int)()
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 193 in require2(int, int)()
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 193 in require2(int, int)()
________________________________________________________________________________________________________
*** CID 1286935: (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 193 in require2(int, int)()
187 require2 (int t1, int t2)
188 {
189 int u = token ();
190 const char *v = advance ();
191 if (u != t1 && u != t2)
192 {
>>> CID 1286935: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(t1, NULL)" leaks it.
193 parse_error ("expected %s or %s, have %s",
194 print_token (t1, 0), print_token (t2, 0),
195 print_token (u, v));
196 return 0;
197 }
198 return v;
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 193 in require2(int, int)()
187 require2 (int t1, int t2)
188 {
189 int u = token ();
190 const char *v = advance ();
191 if (u != t1 && u != t2)
192 {
>>> CID 1286935: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(t2, NULL)" leaks it.
193 parse_error ("expected %s or %s, have %s",
194 print_token (t1, 0), print_token (t2, 0),
195 print_token (u, v));
196 return 0;
197 }
198 return v;
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 193 in require2(int, int)()
187 require2 (int t1, int t2)
188 {
189 int u = token ();
190 const char *v = advance ();
191 if (u != t1 && u != t2)
192 {
>>> CID 1286935: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(u, v)" leaks it.
193 parse_error ("expected %s or %s, have %s",
194 print_token (t1, 0), print_token (t2, 0),
195 print_token (u, v));
196 return 0;
197 }
198 return v;
** CID 1286934: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 1174 in parse_file(const char *)()
________________________________________________________________________________________________________
*** CID 1286934: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 1174 in parse_file(const char *)()
1168 break;
1169
1170 case EOF_TOKEN:
1171 goto eof;
1172
1173 default:
>>> CID 1286934: Resource leaks (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_cur_token()" leaks it.
1174 parse_error ("unexpected top level token, %s", print_cur_token ());
1175 goto eof;
1176 }
1177 lexer_toplevel_done = 1;
1178 }
1179
1180 eof:
1181 advance ();
1182 yyend ();
** CID 1286933: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 564 in option(options *)()
________________________________________________________________________________________________________
*** CID 1286933: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 564 in option(options *)()
558
559 case USER_GTY:
560 advance ();
561 return create_string_option (prev, "user", "");
562
563 default:
>>> CID 1286933: Resource leaks (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_cur_token()" leaks it.
564 parse_error ("expected an option keyword, have %s", print_cur_token ());
565 advance ();
566 return create_string_option (prev, "", "");
567 }
568 }
569
** CID 1286932: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 707 in direct_declarator(type *, const char **, options **, bool)()
________________________________________________________________________________________________________
*** CID 1286932: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 707 in direct_declarator(type *, const char **, options **, bool)()
701 case IGNORABLE_CXX_KEYWORD:
702 /* Any C++ keyword like 'operator' means that we are not looking
703 at a regular data declarator. */
704 return NULL;
705
706 default:
>>> CID 1286932: Resource leaks (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_cur_token()" leaks it.
707 parse_error ("expected '(', ')', 'GTY', or an identifier, have %s",
708 print_cur_token ());
709 /* Do _not_ advance if what we have is a close squiggle brace, as
710 we will get much better error recovery that way. */
711 if (token () != '}')
712 advance ();
** CID 1286931: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 1055 in type(options **, bool)()
________________________________________________________________________________________________________
*** CID 1286931: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 1055 in type(options **, bool)()
1049 return NULL;
1050 }
1051
1052 return create_scalar_type (s);
1053
1054 default:
>>> CID 1286931: Resource leaks (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_cur_token()" leaks it.
1055 parse_error ("expected a type specifier, have %s", print_cur_token ());
1056 advance ();
1057 return create_scalar_type ("erroneous type");
1058 }
1059 }
1060
** CID 1286930: (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 177 in require_without_advance(int)()
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 177 in require_without_advance(int)()
________________________________________________________________________________________________________
*** CID 1286930: (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 177 in require_without_advance(int)()
171 require_without_advance (int t)
172 {
173 int u = token ();
174 const char *v = T.value;
175 if (u != t)
176 {
>>> CID 1286930: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(t, NULL)" leaks it.
177 parse_error ("expected %s, have %s",
178 print_token (t, 0), print_token (u, v));
179 return 0;
180 }
181 return v;
182 }
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 177 in require_without_advance(int)()
171 require_without_advance (int t)
172 {
173 int u = token ();
174 const char *v = T.value;
175 if (u != t)
176 {
>>> CID 1286930: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(u, v)" leaks it.
177 parse_error ("expected %s, have %s",
178 print_token (t, 0), print_token (u, v));
179 return 0;
180 }
181 return v;
182 }
** CID 1286929: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 1052 in type(options **, bool)()
________________________________________________________________________________________________________
*** CID 1286929: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 1052 in type(options **, bool)()
1046 "with automatic GTY markers. Use GTY((user)) to mark "
1047 "this structure.");
1048 advance ();
1049 return NULL;
1050 }
1051
>>> CID 1286929: Resource leaks (RESOURCE_LEAK)
>>> Variable "s" going out of scope leaks the storage it points to.
1052 return create_scalar_type (s);
1053
1054 default:
1055 parse_error ("expected a type specifier, have %s", print_cur_token ());
1056 advance ();
1057 return create_scalar_type ("erroneous type");
** CID 1286927: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 449 in consume_until_comma_or_eos()()
________________________________________________________________________________________________________
*** CID 1286927: Resource leaks (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 449 in consume_until_comma_or_eos()()
443 consume_balanced ('[', ']');
444 break;
445
446 case '}':
447 case ']':
448 case ')':
>>> CID 1286927: Resource leaks (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_cur_token()" leaks it.
449 parse_error ("unmatched '%s' while scanning for ',' or ';'",
450 print_cur_token ());
451 return false;
452
453 case EOF_TOKEN:
454 parse_error ("unexpected end of file while scanning for ',' or ';'");
** CID 1286926: (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 210 in require4(int, int, int, int)()
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 210 in require4(int, int, int, int)()
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 210 in require4(int, int, int, int)()
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 210 in require4(int, int, int, int)()
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 210 in require4(int, int, int, int)()
________________________________________________________________________________________________________
*** CID 1286926: (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 210 in require4(int, int, int, int)()
204 require4 (int t1, int t2, int t3, int t4)
205 {
206 int u = token ();
207 const char *v = advance ();
208 if (u != t1 && u != t2 && u != t3 && u != t4)
209 {
>>> CID 1286926: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(t1, NULL)" leaks it.
210 parse_error ("expected %s, %s, %s or %s, have %s",
211 print_token (t1, 0), print_token (t2, 0),
212 print_token (t3, 0), print_token (t4, 0),
213 print_token (u, v));
214 return 0;
215 }
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 210 in require4(int, int, int, int)()
204 require4 (int t1, int t2, int t3, int t4)
205 {
206 int u = token ();
207 const char *v = advance ();
208 if (u != t1 && u != t2 && u != t3 && u != t4)
209 {
>>> CID 1286926: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(t2, NULL)" leaks it.
210 parse_error ("expected %s, %s, %s or %s, have %s",
211 print_token (t1, 0), print_token (t2, 0),
212 print_token (t3, 0), print_token (t4, 0),
213 print_token (u, v));
214 return 0;
215 }
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 210 in require4(int, int, int, int)()
204 require4 (int t1, int t2, int t3, int t4)
205 {
206 int u = token ();
207 const char *v = advance ();
208 if (u != t1 && u != t2 && u != t3 && u != t4)
209 {
>>> CID 1286926: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(t3, NULL)" leaks it.
210 parse_error ("expected %s, %s, %s or %s, have %s",
211 print_token (t1, 0), print_token (t2, 0),
212 print_token (t3, 0), print_token (t4, 0),
213 print_token (u, v));
214 return 0;
215 }
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 210 in require4(int, int, int, int)()
204 require4 (int t1, int t2, int t3, int t4)
205 {
206 int u = token ();
207 const char *v = advance ();
208 if (u != t1 && u != t2 && u != t3 && u != t4)
209 {
>>> CID 1286926: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(t4, NULL)" leaks it.
210 parse_error ("expected %s, %s, %s or %s, have %s",
211 print_token (t1, 0), print_token (t2, 0),
212 print_token (t3, 0), print_token (t4, 0),
213 print_token (u, v));
214 return 0;
215 }
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 210 in require4(int, int, int, int)()
204 require4 (int t1, int t2, int t3, int t4)
205 {
206 int u = token ();
207 const char *v = advance ();
208 if (u != t1 && u != t2 && u != t3 && u != t4)
209 {
>>> CID 1286926: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(u, v)" leaks it.
210 parse_error ("expected %s, %s, %s or %s, have %s",
211 print_token (t1, 0), print_token (t2, 0),
212 print_token (t3, 0), print_token (t4, 0),
213 print_token (u, v));
214 return 0;
215 }
** CID 1286925: (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 162 in require(int)()
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 162 in require(int)()
________________________________________________________________________________________________________
*** CID 1286925: (RESOURCE_LEAK)
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 162 in require(int)()
156 require (int t)
157 {
158 int u = token ();
159 const char *v = advance ();
160 if (u != t)
161 {
>>> CID 1286925: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(t, NULL)" leaks it.
162 parse_error ("expected %s, have %s",
163 print_token (t, 0), print_token (u, v));
164 return 0;
165 }
166 return v;
167 }
/external/gpl3/gcc.old/dist/gcc/gengtype-parse.c: 162 in require(int)()
156 require (int t)
157 {
158 int u = token ();
159 const char *v = advance ();
160 if (u != t)
161 {
>>> CID 1286925: (RESOURCE_LEAK)
>>> Failing to save or free storage allocated by "print_token(u, v)" leaks it.
162 parse_error ("expected %s, have %s",
163 print_token (t, 0), print_token (u, v));
164 return 0;
165 }
166 return v;
167 }
** CID 460764: Resource leaks (RESOURCE_LEAK)
/usr/xsrc/external/mit/mkfontscale/dist/mkfontscale.c: 989 in doDirectory()
________________________________________________________________________________________________________
*** CID 460764: Resource leaks (RESOURCE_LEAK)
/usr/xsrc/external/mit/mkfontscale/dist/mkfontscale.c: 989 in doDirectory()
983 if(have_face)
984 FT_Done_Face(face);
985 deepDestroyList(xlfd);
986 xlfd = NULL;
987 free(filename);
988 #undef PRIO
>>> CID 460764: Resource leaks (RESOURCE_LEAK)
>>> Variable "xlfd_name" going out of scope leaks the storage it points to.
989 }
990
991 closedir(dirp);
992 n = hashElements(entries);
993 fprintf(fontscale, "%d\n", n);
994 array = hashArray(entries, 1);
** CID 460760: (RESOURCE_LEAK)
/usr/xsrc/external/mit/mkfontscale/dist/mkfontscale.c: 1319 in readEncodings()
/usr/xsrc/external/mit/mkfontscale/dist/mkfontscale.c: 1330 in readEncodings()
________________________________________________________________________________________________________
*** CID 460760: (RESOURCE_LEAK)
/usr/xsrc/external/mit/mkfontscale/dist/mkfontscale.c: 1319 in readEncodings()
1313 if(fullname[0] != '/' && !relative) {
1314 char *n;
1315 n = dsprintf("%s%s", encodingPrefix, fullname);
1316 if(n == NULL) {
1317 fprintf(stderr, "Couldn't allocate name\n");
1318 closedir(dirp);
>>> CID 460760: (RESOURCE_LEAK)
>>> Variable "names" going out of scope leaks the storage it points to.
1319 return -1;
1320 }
1321 encodingsToDo = listConsF(encodingsToDo, "%s %s", *name, n);
1322 free(n);
1323 } else {
1324 encodingsToDo =
/usr/xsrc/external/mit/mkfontscale/dist/mkfontscale.c: 1330 in readEncodings()
1324 encodingsToDo =
1325 listConsF(encodingsToDo, "%s %s", *name, fullname);
1326 }
1327 if(encodingsToDo == NULL) {
1328 fprintf(stderr, "Couldn't allocate encodings\n");
1329 closedir(dirp);
>>> CID 460760: (RESOURCE_LEAK)
>>> Variable "names" going out of scope leaks the storage it points to.
1330 return -1;
1331 }
1332 }
1333 free(names); /* only the spine */
1334 }
1335 closedir(dirp);
1336 return 0;
** CID 30345: (NULL_RETURNS)
/external/gpl3/gcc.old/dist/libiberty/make-relative-prefix.c: 111 in save_string()
/external/gpl3/gcc.old/dist/libiberty/make-relative-prefix.c: 112 in save_string()
________________________________________________________________________________________________________
*** CID 30345: (NULL_RETURNS)
/external/gpl3/gcc.old/dist/libiberty/make-relative-prefix.c: 111 in save_string()
105
106 static char *
107 save_string (const char *s, int len)
108 {
109 char *result = (char *) malloc (len + 1);
110
>>> CID 30345: (NULL_RETURNS)
>>> Dereferencing a pointer that might be null "result" when calling "memcpy".
111 memcpy (result, s, len);
112 result[len] = 0;
113 return result;
114 }
115
116 /* Split a filename into component directories. */
/external/gpl3/gcc.old/dist/libiberty/make-relative-prefix.c: 112 in save_string()
106 static char *
107 save_string (const char *s, int len)
108 {
109 char *result = (char *) malloc (len + 1);
110
111 memcpy (result, s, len);
>>> CID 30345: (NULL_RETURNS)
>>> Dereferencing a null pointer "result".
112 result[len] = 0;
113 return result;
114 }
115
116 /* Split a filename into component directories. */
117
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRb2JZfDAOAZcqzsy8LMBKBjWas0CuiLQxeHDPm0bvVkx3qGSbylcqhUWgyuH34f4u8-3D_XWm3CUIFU8ffmjzuNhQ8cIHoQgXzXkm61Fmjr59D05UMU6u9jXkqb2gJpjJ6JRiH38Q0xvgjUyDuM8PrgN2bqomaEN7cYpxn6ZQnRCpgeWWC-2Bgw5aDUitO4Ygn1m-2BLqx9JuqLHYcoH9vz1BSpCCkWdK2geIGjqLGSQzFZzaxaCgEx-2FogbIxbLQ9aHuoNXqR9Jy569pg-2FjSpiFciT9-2B46XaGKnTs3S6vYKRJdI6ij3EU-3D
To manage Coverity Scan email notifications for "coverity-updates%netbsd.org@localhost", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4m7U7Yoel-2F6MYPxol7ToiLwYIjoNbVQOCAwEeTNJofEDwTlN0JRhKMyijhpnAObR-2FlLVG-2Fr3EBKWgiICNdX1HPA6Ws0-2F1wHBf2tG9AnMDB8g-3D_XWm3CUIFU8ffmjzuNhQ8cIHoQgXzXkm61Fmjr59D05UMU6u9jXkqb2gJpjJ6JRiH38Q0xvgjUyDuM8PrgN2bqh7bEjuSP9aodwdaYKA7Ew4FhcN3u3MshnNnFRiVhCfFw6CSwXb-2FvrPsTJfKGI-2F-2Fex2JbEyGblqA-2FGaG-2BRX9tPft4j0nab47tPN73FoYZRskAWsR12vD-2FXF6BDL-2B1rqCX1lSQoYxzwBAhJnuqTphB48-3D
Home |
Main Index |
Thread Index |
Old Index