diff for duplicates of <1531555951-9627-1-git-send-email-asmadeus@codewreck.org> diff --git a/a/1.txt b/N1/1.txt index d93307a..3bb1ee5 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,8 +1,8 @@ Besides being simpler, using strscpy instead of strncpy+truncation fixes part of the following class of new gcc warnings: - drivers/gpu/drm/i915/intel_tv.c: In function ?intel_tv_get_modes?: - drivers/gpu/drm/i915/intel_tv.c:1358:3: error: ?strncpy? specified bound 32 equals + drivers/gpu/drm/i915/intel_tv.c: In function ‘intel_tv_get_modes’: + drivers/gpu/drm/i915/intel_tv.c:1358:3: error: ‘strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncation] strncpy(mode_ptr->name, input->name, DRM_DISPLAY_MODE_LEN); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -69,22 +69,22 @@ index 000000000000..dd157fc8ec5f +virtual report +virtual org + -+ at r@ ++@r@ +expression dest, src, sz; +position p; +@@ + -+strncpy at p(dest, src, sz); ++strncpy@p(dest, src, sz); +dest[sz - 1] = '\0'; + -+ at script:python depends on org@ ++@script:python depends on org@ +p << r.p; +@@ + +msg = "strncpy followed by truncation can be strscpy, if the destination buffer does not need to be fully overwritten" +cocci.print_main(msg, p) + -+ at script:python depends on report@ ++@script:python depends on report@ +p << r.p; +@@ + diff --git a/a/content_digest b/N1/content_digest index c3c3f93..890b90b 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,15 +1,23 @@ "ref\01531444483-17338-1-git-send-email-asmadeus@codewreck.org\0" - "From\0asmadeus@codewreck.org (Dominique Martinet)\0" - "Subject\0[Cocci] [PATCH v2] coccinelle: strncpy+truncation by strscpy\0" + "From\0Dominique Martinet <asmadeus@codewreck.org>\0" + "Subject\0[PATCH v2] coccinelle: strncpy+truncation by strscpy\0" "Date\0Sat, 14 Jul 2018 10:12:31 +0200\0" - "To\0cocci@systeme.lip6.fr\0" + "To\0Masahiro Yamada <yamada.masahiro@socionext.com>\0" + "Cc\0Dominique Martinet <asmadeus@codewreck.org>" + " Ville Syrj\303\244l\303\244 <ville.syrjala@linux.intel.com>" + Julia Lawall <Julia.Lawall@lip6.fr> + Gilles Muller <Gilles.Muller@lip6.fr> + Nicolas Palix <nicolas.palix@imag.fr> + Michal Marek <michal.lkml@markovi.net> + cocci@systeme.lip6.fr + " linux-kernel@vger.kernel.org\0" "\00:1\0" "b\0" "Besides being simpler, using strscpy instead of strncpy+truncation\n" "fixes part of the following class of new gcc warnings:\n" "\n" - " drivers/gpu/drm/i915/intel_tv.c: In function ?intel_tv_get_modes?:\n" - " drivers/gpu/drm/i915/intel_tv.c:1358:3: error: ?strncpy? specified bound 32 equals\n" + " drivers/gpu/drm/i915/intel_tv.c: In function \342\200\230intel_tv_get_modes\342\200\231:\n" + " drivers/gpu/drm/i915/intel_tv.c:1358:3: error: \342\200\230strncpy\342\200\231 specified bound 32 equals\n" " destination size [-Werror=stringop-truncation]\n" " strncpy(mode_ptr->name, input->name, DRM_DISPLAY_MODE_LEN);\n" " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" @@ -76,22 +84,22 @@ "+virtual report\n" "+virtual org\n" "+\n" - "+ at r@\n" + "+@r@\n" "+expression dest, src, sz;\n" "+position p;\n" "+@@\n" "+\n" - "+strncpy at p(dest, src, sz);\n" + "+strncpy@p(dest, src, sz);\n" "+dest[sz - 1] = '\\0';\n" "+\n" - "+ at script:python depends on org@\n" + "+@script:python depends on org@\n" "+p << r.p;\n" "+@@\n" "+\n" "+msg = \"strncpy followed by truncation can be strscpy, if the destination buffer does not need to be fully overwritten\"\n" "+cocci.print_main(msg, p)\n" "+\n" - "+ at script:python depends on report@\n" + "+@script:python depends on report@\n" "+p << r.p;\n" "+@@\n" "+\n" @@ -109,4 +117,4 @@ "-- \n" 2.17.1 -222fd6065a6d6c3b4ffcd7396f319936299c75c559ada127c4eb78da16d7cf21 +b9c40a337c7d910e6c71f9e09ba090e0287718123d2e4fd7d6cdc0ce364c5d85
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.