Whamcloud - gitweb
i=rread,b=20771:
authorisaac <isaac>
Mon, 21 Sep 2009 15:25:23 +0000 (15:25 +0000)
committerisaac <isaac>
Mon, 21 Sep 2009 15:25:23 +0000 (15:25 +0000)
- fixed vulnerable snprintf usage in  ptlrpcd_start().

lustre/ptlrpc/ptlrpcd.c

index 9171ccf..c8f043b 100644 (file)
@@ -360,7 +360,7 @@ int ptlrpcd_start(const char *name, struct ptlrpcd_ctl *pc)
         init_completion(&pc->pc_starting);
         init_completion(&pc->pc_finishing);
         spin_lock_init(&pc->pc_lock);
-        snprintf (pc->pc_name, sizeof (pc->pc_name), name);
+        snprintf(pc->pc_name, sizeof (pc->pc_name), "%s", name);
         pc->pc_set = ptlrpc_prep_set();
         if (pc->pc_set == NULL)
                 GOTO(out, rc = -ENOMEM);