(savedir): Check for size zero before invoking malloc; this can occur if st_size arg overflows on conversion to unsigned int. All callers now cast st_size arg to unsigned int.