IPC: resolve Coverity warnings
This commit is contained in:
parent
8c5d506b8a
commit
fd8c6c1d30
1 changed files with 2 additions and 3 deletions
|
@ -399,7 +399,7 @@ int do_semctl(message *m)
|
||||||
printf("SEMCTL: SETALL val: [%d] %d\n", i, buf[i]);
|
printf("SEMCTL: SETALL val: [%d] %d\n", i, buf[i]);
|
||||||
#endif
|
#endif
|
||||||
for (i = 0; i < sem->semid_ds.sem_nsems; i++) {
|
for (i = 0; i < sem->semid_ds.sem_nsems; i++) {
|
||||||
if (buf[i] < 0 || buf[i] > SEMVMX) {
|
if (buf[i] > SEMVMX) {
|
||||||
free(buf);
|
free(buf);
|
||||||
update_semaphores();
|
update_semaphores();
|
||||||
return ERANGE;
|
return ERANGE;
|
||||||
|
@ -485,8 +485,7 @@ int do_semop(message *m)
|
||||||
/* check for value range */
|
/* check for value range */
|
||||||
r = EFBIG;
|
r = EFBIG;
|
||||||
for (i = 0; i < nsops; i++)
|
for (i = 0; i < nsops; i++)
|
||||||
if (sops[i].sem_num < 0 ||
|
if (sops[i].sem_num >= sem->semid_ds.sem_nsems)
|
||||||
sops[i].sem_num >= sem->semid_ds.sem_nsems)
|
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
/* check for duplicate number */
|
/* check for duplicate number */
|
||||||
|
|
Loading…
Reference in a new issue