diff for duplicates of <20200325124124.32648-24-acme@kernel.org> diff --git a/a/1.txt b/N1/1.txt index 903ec7f..fff1696 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -36,7 +36,7 @@ index 983b7388f22b..dc5c5e6fc502 100644 /* get the highest possible cpu number for a sparse allocation */ ret = snprintf(path, PATH_MAX, "%s/devices/system/cpu/possible", mnt); -- if (ret = PATH_MAX) { +- if (ret == PATH_MAX) { + if (ret >= PATH_MAX) { pr_err("sysfs path crossed PATH_MAX(%d) size\n", PATH_MAX); goto out; @@ -45,7 +45,7 @@ index 983b7388f22b..dc5c5e6fc502 100644 /* get the highest present cpu number for a sparse allocation */ ret = snprintf(path, PATH_MAX, "%s/devices/system/cpu/present", mnt); -- if (ret = PATH_MAX) { +- if (ret == PATH_MAX) { + if (ret >= PATH_MAX) { pr_err("sysfs path crossed PATH_MAX(%d) size\n", PATH_MAX); goto out; @@ -54,7 +54,7 @@ index 983b7388f22b..dc5c5e6fc502 100644 /* get the highest possible cpu number for a sparse allocation */ ret = snprintf(path, PATH_MAX, "%s/devices/system/node/possible", mnt); -- if (ret = PATH_MAX) { +- if (ret == PATH_MAX) { + if (ret >= PATH_MAX) { pr_err("sysfs path crossed PATH_MAX(%d) size\n", PATH_MAX); goto out; @@ -63,7 +63,7 @@ index 983b7388f22b..dc5c5e6fc502 100644 return 0; n = snprintf(path, PATH_MAX, "%s/devices/system/node", mnt); -- if (n = PATH_MAX) { +- if (n == PATH_MAX) { + if (n >= PATH_MAX) { pr_err("sysfs path crossed PATH_MAX(%d) size\n", PATH_MAX); return -1; @@ -72,7 +72,7 @@ index 983b7388f22b..dc5c5e6fc502 100644 continue; n = snprintf(buf, PATH_MAX, "%s/%s", path, dent1->d_name); -- if (n = PATH_MAX) { +- if (n == PATH_MAX) { + if (n >= PATH_MAX) { pr_err("sysfs path crossed PATH_MAX(%d) size\n", PATH_MAX); continue; diff --git a/a/content_digest b/N1/content_digest index b165a81..861cd1e 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,7 @@ "ref\020200325124124.32648-1-acme@kernel.org\0" "From\0Arnaldo Carvalho de Melo <acme@kernel.org>\0" "Subject\0[PATCH 23/24] perf cpumap: Fix snprintf overflow check\0" - "Date\0Wed, 25 Mar 2020 12:41:23 +0000\0" + "Date\0Wed, 25 Mar 2020 09:41:23 -0300\0" "To\0Ingo Molnar <mingo@kernel.org>" " Thomas Gleixner <tglx@linutronix.de>\0" "Cc\0Jiri Olsa <jolsa@kernel.org>" @@ -61,7 +61,7 @@ " \n" " \t/* get the highest possible cpu number for a sparse allocation */\n" " \tret = snprintf(path, PATH_MAX, \"%s/devices/system/cpu/possible\", mnt);\n" - "-\tif (ret = PATH_MAX) {\n" + "-\tif (ret == PATH_MAX) {\n" "+\tif (ret >= PATH_MAX) {\n" " \t\tpr_err(\"sysfs path crossed PATH_MAX(%d) size\\n\", PATH_MAX);\n" " \t\tgoto out;\n" @@ -70,7 +70,7 @@ " \n" " \t/* get the highest present cpu number for a sparse allocation */\n" " \tret = snprintf(path, PATH_MAX, \"%s/devices/system/cpu/present\", mnt);\n" - "-\tif (ret = PATH_MAX) {\n" + "-\tif (ret == PATH_MAX) {\n" "+\tif (ret >= PATH_MAX) {\n" " \t\tpr_err(\"sysfs path crossed PATH_MAX(%d) size\\n\", PATH_MAX);\n" " \t\tgoto out;\n" @@ -79,7 +79,7 @@ " \n" " \t/* get the highest possible cpu number for a sparse allocation */\n" " \tret = snprintf(path, PATH_MAX, \"%s/devices/system/node/possible\", mnt);\n" - "-\tif (ret = PATH_MAX) {\n" + "-\tif (ret == PATH_MAX) {\n" "+\tif (ret >= PATH_MAX) {\n" " \t\tpr_err(\"sysfs path crossed PATH_MAX(%d) size\\n\", PATH_MAX);\n" " \t\tgoto out;\n" @@ -88,7 +88,7 @@ " \t\treturn 0;\n" " \n" " \tn = snprintf(path, PATH_MAX, \"%s/devices/system/node\", mnt);\n" - "-\tif (n = PATH_MAX) {\n" + "-\tif (n == PATH_MAX) {\n" "+\tif (n >= PATH_MAX) {\n" " \t\tpr_err(\"sysfs path crossed PATH_MAX(%d) size\\n\", PATH_MAX);\n" " \t\treturn -1;\n" @@ -97,7 +97,7 @@ " \t\t\tcontinue;\n" " \n" " \t\tn = snprintf(buf, PATH_MAX, \"%s/%s\", path, dent1->d_name);\n" - "-\t\tif (n = PATH_MAX) {\n" + "-\t\tif (n == PATH_MAX) {\n" "+\t\tif (n >= PATH_MAX) {\n" " \t\t\tpr_err(\"sysfs path crossed PATH_MAX(%d) size\\n\", PATH_MAX);\n" " \t\t\tcontinue;\n" @@ -105,4 +105,4 @@ "-- \n" 2.21.1 -4d1a118e35263255e04b2258e3d52e63999aa2d060bd51f45dcea6c7675fc95a +6ef11bcb948ba8122896c20f0fed92de97224d532f7b0e2dc8455de100862903
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.