Whamcloud - gitweb
b=23663 fix buffer overflow in liblustre
[fs/lustre-release.git] / lustre / liblustre / super.c
index 31987ac..f7e1693 100644 (file)
@@ -1847,7 +1847,7 @@ llu_fsswop_mount(const char *source,
         struct lustre_md md;
         class_uuid_t uuid;
         struct config_llog_instance cfg = {0, };
-        char ll_instance[sizeof(sbi) * 2 + 1];
+        char ll_instance[sizeof(sbi) * 2 + 3];
         struct lustre_profile *lprof;
         char *zconf_mgsnid, *zconf_profile;
         char *osc = NULL, *mdc = NULL;
@@ -1878,7 +1878,7 @@ llu_fsswop_mount(const char *source,
 
         /* generate a string unique to this super, let's try
          the address of the super itself.*/
-        sprintf(ll_instance, "%p", sbi);
+        snprintf(ll_instance, sizeof(ll_instance), "%p", sbi);
 
         /* retrive & parse config log */
         cfg.cfg_instance = ll_instance;