scrub/scrub-2.6.1-analyzer-fixes.patch
DistroBaker f7daba9a70 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/scrub.git#fcef9c97a0cecf56658438e4712073a3f75780e1
2021-03-18 19:30:17 +00:00

32 lines
1.3 KiB
Diff

diff -up scrub-2.6.1/src/fillfile.c.analyzer-fixes scrub-2.6.1/src/fillfile.c
--- scrub-2.6.1/src/fillfile.c.analyzer-fixes 2021-03-18 10:42:37.201845461 -0400
+++ scrub-2.6.1/src/fillfile.c 2021-03-18 10:43:38.358151439 -0400
@@ -131,10 +131,13 @@ refill_init(struct memstruct **mpp, refi
if (!(mp = malloc(sizeof(struct memstruct))))
goto nomem;
- if (!(mp->buf = malloc(memsize)))
+ if (!(mp->buf = malloc(memsize))) {
+ free(mp);
goto nomem;
+ }
mp->size = memsize;
mp->refill = refill;
+ mp->thd = 0;
#if WITH_PTHREADS
if (!no_threads) {
if ((mp->err = pthread_create(&mp->thd, NULL, refill_thread, mp))) {
diff -up scrub-2.6.1/src/scrub.c.analyzer-fixes scrub-2.6.1/src/scrub.c
diff -up scrub-2.6.1/src/sig.c.analyzer-fixes scrub-2.6.1/src/sig.c
--- scrub-2.6.1/src/sig.c.analyzer-fixes 2021-03-18 10:44:20.715363360 -0400
+++ scrub-2.6.1/src/sig.c 2021-03-18 10:44:54.319531489 -0400
@@ -74,7 +74,7 @@ writesig(char *path)
goto nomem;
if ((fd = open(path, O_RDWR)) < 0)
goto error;
- if ((n = read_all(fd, buf, blocksize)) < 0)
+ if (read_all(fd, buf, blocksize) < 0)
goto error;
memcpy(buf, SCRUB_MAGIC, sizeof(SCRUB_MAGIC));
if (lseek(fd, 0, SEEK_SET) < 0)