diff --git a/0004-show-dev-name-in-container.patch b/0004-show-dev-name-in-container.patch index e835102..03078c6 100644 --- a/0004-show-dev-name-in-container.patch +++ b/0004-show-dev-name-in-container.patch @@ -91,7 +91,7 @@ index 6387012..91de9f9 100644 + lxcfs_error("Error opening pipe for reading: %s\n", strerror(errno)); + goto err; + } -+ while (fscanf(stream, "%s%d", dev_name, &dev_num) == 2) { ++ while (fscanf(stream, "%100s%d", dev_name, &dev_num) == 2) { + if (dev_num == 0) { + break; + } diff --git a/0009-set-null-after-free.patch b/0009-set-null-after-free.patch index a1dd0df..c9d3012 100644 --- a/0009-set-null-after-free.patch +++ b/0009-set-null-after-free.patch @@ -657,8 +657,8 @@ index 9b9f180..b921d7e 100644 lxcfs_error("Error opening pipe for reading: %s\n", strerror(errno)); goto err; } -- while (fscanf(stream, "%s%d", dev_name, &dev_num) == 2) { -+ while (fscanf(stream[0], "%s%d", dev_name, &dev_num) == 2) { +- while (fscanf(stream, "%100s%d", dev_name, &dev_num) == 2) { ++ while (fscanf(stream[0], "%100s%d", dev_name, &dev_num) == 2) { if (dev_num == 0) { break; } diff --git a/0010-fix-hang.patch b/0010-fix-hang.patch index e86bb34..b5de6be 100644 --- a/0010-fix-hang.patch +++ b/0010-fix-hang.patch @@ -33,7 +33,7 @@ index b921d7e..1023e7f 100644 } + wait_for_pid(child_pid); + child_pid = 0; - while (fscanf(stream[0], "%s%d", dev_name, &dev_num) == 2) { + while (fscanf(stream[0], "%100s%d", dev_name, &dev_num) == 2) { if (dev_num == 0) { break; @@ -4148,7 +4161,9 @@ static int proc_diskstats_read(char *buf, size_t size, off_t offset, diff --git a/0017-diskstats-support-devicemapper-device.patch b/0017-diskstats-support-devicemapper-device.patch index 5e15c91..5c80f45 100644 --- a/0017-diskstats-support-devicemapper-device.patch +++ b/0017-diskstats-support-devicemapper-device.patch @@ -63,7 +63,7 @@ diff --git a/bindings.c b/bindings.c write, write_merged, write_sectors, write_ticks, ios_pgr, tot_ticks, rq_ticks); - else + else if (need_record_diskstats(major, minor)) { -+ sscanf(line, "%u %u %s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n", ++ sscanf(line, "%u %u %71s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n", + &major, &minor, tmp_dev_name, &read, &read_merged, &read_sectors, &read_ticks, + &write, &write_merged, &write_sectors, &write_ticks, &ios_pgr, &tot_ticks, &rq_ticks); + snprintf(lbuf, 256, "%u %u %s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",