[haiku-commits] r40636 - haiku/trunk/src/add-ons/input_server/methods/canna/lib

  • From: jonas@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 23 Feb 2011 03:54:16 +0100 (CET)

Author: kirilla
Date: 2011-02-23 03:54:16 +0100 (Wed, 23 Feb 2011)
New Revision: 40636
Changeset: http://dev.haiku-os.org/changeset/40636

Modified:
   haiku/trunk/src/add-ons/input_server/methods/canna/lib/engine.c
Log:
Unsafe use of strncpy replaced by strlcpy. CID 2214.

Modified: haiku/trunk/src/add-ons/input_server/methods/canna/lib/engine.c
===================================================================
--- haiku/trunk/src/add-ons/input_server/methods/canna/lib/engine.c     
2011-02-23 02:25:22 UTC (rev 40635)
+++ haiku/trunk/src/add-ons/input_server/methods/canna/lib/engine.c     
2011-02-23 02:54:16 UTC (rev 40636)
@@ -36,11 +36,8 @@
 int
 RkSetServerName(char *s)
 {
-  if (s)
-    (void)strncpy(iroha_server_name, s, CANNA_SERVER_NAME_LEN);
-  else
-    iroha_server_name[0] = '\0';
-  return 0;
+       strlcpy(iroha_server_name, s, CANNA_SERVER_NAME_LEN);
+       return 0;
 }
 
 char *


Other related posts:

  • » [haiku-commits] r40636 - haiku/trunk/src/add-ons/input_server/methods/canna/lib - jonas