Re: [patch 1/1] 000_hardened_build

Aruna Balakrishnaiah <[email protected]> Wed, 26 Mar 2014 15:34:41 +0530
Newsgroups gmane.linux.tools.diag.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============9167603120543701138==
Content-Type: multipart/alternative;
	boundary="------------050708030901030805070007"

This is a multi-part message in MIME format.
--------------050708030901030805070007
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

This patch is already in the git tree.

Commit id of the same:
commit 72e921f7c1aa1c9ce9ed104b2d0fa38cbf3eceec
Author: Frederic Bonnard <[email protected]>
Date:   Tue Mar 11 12:05:41 2014 +0100


On Tuesday 25 March 2014 06:37 PM, [email protected] wrote:
> 000_hardened_build
>
> Signed-off-by: Frédéric Bonnard<[email protected]>
> --- a/src/servicelog.c
> +++ b/src/servicelog.c
> @@ -279,7 +279,7 @@
>   			if (newline != NULL) {
>   				prnt_len = newline - &tmpbuf[offset] + 1;
>   				snprintf(buf + buf_offset, prnt_len,
> -					 &tmpbuf[offset]);
> +					 "%s", &tmpbuf[offset]);
>   				buf_offset = strlen(buf);
>   				buf_offset += sprintf(buf + buf_offset, "\n");
>   				offset += prnt_len;
> @@ -297,7 +297,7 @@
>   			}
>
>   			/* print up to the last brkpt */
> -			snprintf(buf + buf_offset, prnt_len, &tmpbuf[offset]);
> +			snprintf(buf + buf_offset, prnt_len, "%s", &tmpbuf[offset]);
>   			buf_offset = strlen(buf);
>   			buf_offset += sprintf(buf + buf_offset, "\n");
>   			offset += prnt_len;
> @@ -305,10 +305,10 @@
>   		}
>   	}
>
> -	prnt_len = sprintf(buf + buf_offset, &tmpbuf[offset]);
> +	prnt_len = sprintf(buf + buf_offset, "%s", &tmpbuf[offset]);
>   	line_offset += prnt_len;
>
> -	return fprintf(stream, buf);
> +	return fprintf(stream, "%s", buf);
>   }
>
>   /**
> @@ -583,7 +583,7 @@
>
>   	rc = sqlite3_open(log->location, &(log->db));
>   	if (rc) {
> -		snprintf(log->error, SL_MAX_ERR, sqlite3_errmsg(log->db));
> +		snprintf(log->error, SL_MAX_ERR, "%s", sqlite3_errmsg(log->db));
>   		servicelog_close(log);
>   		return ENOENT;
>   	}
> --- a/src/v29_print.c
> +++ b/src/v29_print.c
> @@ -152,7 +152,7 @@
>
>               if (newline != NULL) {
>                   prnt_len = newline - &tmpbuf[offset] + 1;
> -                snprintf(buf + buf_offset, prnt_len, &tmpbuf[offset]);
> +                snprintf(buf + buf_offset, prnt_len, "%s", &tmpbuf[offset]);
>                   buf_offset = strlen(buf);
>                   buf_offset += sprintf(buf + buf_offset, "\n");
>                   offset += prnt_len;
> @@ -171,7 +171,7 @@
>               }
>
>               /* print up to the last brkpt */
> -            snprintf(buf + buf_offset, prnt_len, &tmpbuf[offset]);
> +            snprintf(buf + buf_offset, prnt_len, "%s", &tmpbuf[offset]);
>               buf_offset = strlen(buf);
>               buf_offset += sprintf(buf + buf_offset, "\n");
>               offset += prnt_len;
> @@ -180,10 +180,10 @@
>
>       }
>
> -    prnt_len = sprintf(buf + buf_offset, &tmpbuf[offset]);
> +    prnt_len = sprintf(buf + buf_offset, "%s", &tmpbuf[offset]);
>       line_offset += prnt_len;
>
> -    len = fprintf(stream, buf);
> +    len = fprintf(stream, "%s", buf);
>
>       return len;
>   }
>
>
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
>
>
> _______________________________________________
> Linux-diag-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/linux-diag-devel


--------------050708030901030805070007
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><tt>This patch is already in the git
        tree.</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Commit id of the same:</tt><tt><br>
      </tt><tt>commit 72e921f7c1aa1c9ce9ed104b2d0fa38cbf3eceec</tt><tt><br>
      </tt><tt>Author: Frederic Bonnard
        <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a></tt><tt><br>
      </tt><tt>Date:&nbsp;&nbsp; Tue Mar 11 12:05:41 2014 +0100</tt><tt><br>
      </tt><br>
      <br>
      On Tuesday 25 March 2014 06:37 PM, <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
      wrote:<br>
    </div>
    <blockquote cite="mid:[email protected]"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-western">
        <pre wrap="">000_hardened_build

Signed-off-by: Fr&Atilde;&copy;d&Atilde;&copy;ric Bonnard <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a>
--- a/src/servicelog.c
+++ b/src/servicelog.c
@@ -279,7 +279,7 @@
 			if (newline != NULL) {
 				prnt_len = newline - &amp;tmpbuf[offset] + 1;
 				snprintf(buf + buf_offset, prnt_len,
-					 &amp;tmpbuf[offset]);
+					 "%s", &amp;tmpbuf[offset]);
 				buf_offset = strlen(buf);
 				buf_offset += sprintf(buf + buf_offset, "\n");
 				offset += prnt_len;
@@ -297,7 +297,7 @@
 			}

 			/* print up to the last brkpt */
-			snprintf(buf + buf_offset, prnt_len, &amp;tmpbuf[offset]);
+			snprintf(buf + buf_offset, prnt_len, "%s", &amp;tmpbuf[offset]);
 			buf_offset = strlen(buf);
 			buf_offset += sprintf(buf + buf_offset, "\n");
 			offset += prnt_len;
@@ -305,10 +305,10 @@
 		}
 	}

-	prnt_len = sprintf(buf + buf_offset, &amp;tmpbuf[offset]);
+	prnt_len = sprintf(buf + buf_offset, "%s", &amp;tmpbuf[offset]);
 	line_offset += prnt_len;

-	return fprintf(stream, buf);
+	return fprintf(stream, "%s", buf);
 }

 /**
@@ -583,7 +583,7 @@

 	rc = sqlite3_open(log-&gt;location, &amp;(log-&gt;db));
 	if (rc) {
-		snprintf(log-&gt;error, SL_MAX_ERR, sqlite3_errmsg(log-&gt;db));
+		snprintf(log-&gt;error, SL_MAX_ERR, "%s", sqlite3_errmsg(log-&gt;db));
 		servicelog_close(log);
 		return ENOENT;
 	}
--- a/src/v29_print.c
+++ b/src/v29_print.c
@@ -152,7 +152,7 @@

             if (newline != NULL) {
                 prnt_len = newline - &amp;tmpbuf[offset] + 1;
-                snprintf(buf + buf_offset, prnt_len, &amp;tmpbuf[offset]);
+                snprintf(buf + buf_offset, prnt_len, "%s", &amp;tmpbuf[offset]);
                 buf_offset = strlen(buf);
                 buf_offset += sprintf(buf + buf_offset, "\n");
                 offset += prnt_len;
@@ -171,7 +171,7 @@
             }

             /* print up to the last brkpt */
-            snprintf(buf + buf_offset, prnt_len, &amp;tmpbuf[offset]);
+            snprintf(buf + buf_offset, prnt_len, "%s", &amp;tmpbuf[offset]);
             buf_offset = strlen(buf);
             buf_offset += sprintf(buf + buf_offset, "\n");
             offset += prnt_len;
@@ -180,10 +180,10 @@

     }

-    prnt_len = sprintf(buf + buf_offset, &amp;tmpbuf[offset]);
+    prnt_len = sprintf(buf + buf_offset, "%s", &amp;tmpbuf[offset]);
     line_offset += prnt_len;

-    len = fprintf(stream, buf);
+    len = fprintf(stream, "%s", buf);

     return len;
 }


</pre>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-western">
        <pre wrap="">------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://p.sf.net/sfu/13534_NeoTech">http://p.sf.net/sfu/13534_NeoTech</a></pre>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-western">
        <pre wrap="">_______________________________________________
Linux-diag-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/linux-diag-devel">https://lists.sourceforge.net/lists/listinfo/linux-diag-devel</a>
</pre>
      </div>
    </blockquote>
    <br>
  </body>
</html>

--------------050708030901030805070007--



--===============9167603120543701138==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
--===============9167603120543701138==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Linux-diag-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-diag-devel

--===============9167603120543701138==--