- request_resize (cols, def(esc_args[0], cfg.height), 0);
+ unsigned int newrows = def(esc_args[0], cfg.height);
+ /* Hack: prevent big-resize DoS attack. */
+ if (newrows > max(512, cfg.height))
+ newrows = max(512, cfg.height);
+ request_resize (cols, newrows, 0);