New Defects reported by Coverity Scan for RTEMS

scan-admin at coverity.com scan-admin at coverity.com
Thu Mar 25 05:23:16 UTC 2021


Hi,

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

2 new defect(s) introduced to RTEMS found with Coverity Scan.


New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)


** CID 1049147:  Error handling issues  (CHECKED_RETURN)
/cpukit/libmisc/uuid/gen_uuid.c: 168 in get_random_fd()


________________________________________________________________________________________________________
*** CID 1049147:  Error handling issues  (CHECKED_RETURN)
/cpukit/libmisc/uuid/gen_uuid.c: 168 in get_random_fd()
162     		fd = open("/dev/urandom", O_RDONLY);
163     		if (fd == -1)
164     			fd = open("/dev/random", O_RDONLY | O_NONBLOCK);
165     		if (fd >= 0) {
166     			i = fcntl(fd, F_GETFD);
167     			if (i >= 0)
>>>     CID 1049147:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "fcntl(fd, 2, i | 1)" without checking return value. This library function may fail and return an error code. [Note: The source code implementation of the function has been overridden by a builtin model.]
168     				fcntl(fd, F_SETFD, i | FD_CLOEXEC);
169     		}
170     #endif
171     		srand((getpid() << ((sizeof(pid_t)*CHAR_BIT)>>1)) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec);
172     #ifdef DO_JRAND_MIX
173     		jrand_seed[0] = getpid() ^ (tv.tv_sec & 0xFFFF);

** CID 1049146:  Error handling issues  (CHECKED_RETURN)
/cpukit/libmisc/uuid/gen_uuid.c: 429 in get_clock()


________________________________________________________________________________________________________
*** CID 1049146:  Error handling issues  (CHECKED_RETURN)
/cpukit/libmisc/uuid/gen_uuid.c: 429 in get_clock()
423     		if (ftruncate(state_fd, len) < 0) {
424     			fprintf(state_f, "                   \n");
425     			fflush(state_f);
426     		}
427     		rewind(state_f);
428     		fl.l_type = F_UNLCK;
>>>     CID 1049146:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "fcntl(state_fd, 8, &fl)" without checking return value. This library function may fail and return an error code. [Note: The source code implementation of the function has been overridden by a builtin model.]
429     		fcntl(state_fd, F_SETLK, &fl);
430     	}
431     
432     	*clock_high = clock_reg >> 32;
433     	*clock_low = clock_reg;
434     	*ret_clock_seq = clock_seq;


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQ4-2B8hpujh0hTgQljRGId4Dg-3D-3DvssS_EU3W9teASMK00lBXX9WT4lsogDrkCcNZLvg-2FVxwAXMoo1yx3DPK-2FYKHOupGmGcenuTfbZonz8NoO6K2fhPxguKvyO8v02iAk9KFxlt6OSIPO7CnH17uEfNiwfTywNvuJ2IHc-2FDFVtjm083nBGY1bgjblL37hMQnnFgi5ogwUSaSianc11iB-2FNyp-2FcuCVPSNcSrWv8S36kAoOgQMlXlveyjZqVGBbCPxvaw-2BIodgPni0-3D



More information about the build mailing list