avoid the bad_alloc when overflow.
avoid the bad_alloc when overflow.

microsoft/LightGBM,henry0312/LightGBM,henry0312/LightGBM,henry0312/LightGBM,henry0312/LightGBM,microsoft/LightGBM,microsoft/LightGBM,microsoft/LightGBM,henry0312/LightGBM,microsoft/LightGBM