One byte shorter for logname allocation in mgc_llog_local_copy(),
which might cause buffer overflow in the following sprintf().
Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Ie758c3650c1cf7848874d9fd3a02a5618043eb8f
Reviewed-on: http://review.whamcloud.com/14146
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
* - if failed then move bakup to logname again
*/
- OBD_ALLOC(temp_log, strlen(logname) + 1);
+ OBD_ALLOC(temp_log, strlen(logname) + 2);
if (!temp_log)
RETURN(-ENOMEM);
sprintf(temp_log, "%sT", logname);
obd->obd_name, logname, rc);
}
llog_erase(env, lctxt, NULL, temp_log);
- OBD_FREE(temp_log, strlen(logname) + 1);
+ OBD_FREE(temp_log, strlen(logname) + 2);
return rc;
}