Whamcloud - gitweb
LU-5832 utils: Fix buffer overflow in bound string copy
[fs/lustre-release.git] / lustre / utils / lr_reader.c
index 84346e1..6eb2cba 100644 (file)
@@ -26,6 +26,8 @@
 /*
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -192,8 +194,8 @@ int main(int argc, char *const argv[])
                /* If neither is set, we're pre-1.4.6, make a guess. */
                /* Construct debugfs command line. */
                memset(cmd, 0, sizeof(cmd));
-               sprintf(cmd, "%s -c -R 'rdump /%s %s' %s",
-                       DEBUGFS, MDT_LOGS_DIR, tmpdir, dev);
+               snprintf(cmd, sizeof(cmd), "%s -c -R 'rdump /%s %s' %s",
+                        DEBUGFS, MDT_LOGS_DIR, tmpdir, dev);
 
                run_command(cmd);