Project

General

Profile

Actions

Submit #2791

closed

Float exception with vi

Added by dclink almost 10 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Userland
Target version:
Start date:
02/21/2015
Due date:
% Done:

100%

Estimated time:

Description

How to reproduce :
- set COLUMNS or LINES env var with unexpected values.
Proposed fix :
- Fallback to default values in those cases.


Files

patch-nvi.txt (965 Bytes) patch-nvi.txt dclink, 02/21/2015 10:29 AM
Actions #1

Updated by dragonflybsd1 over 9 years ago

looks reasonable to me.

Actions #2

Updated by vadaszi over 9 years ago

  • Status changed from New to In Progress

It would be nice, if the default values for row and col wouldn't be duplicated by this change.
The errno variable should be explicitly set to 0 before calling strtol, when you want to check errno != 0 afterwards.
Also we it would make sense to fallback to default values when negative values are given for COLUMNS or LINES.

Note that there are a few other places which call getenv("LINES") or getenv("COLUMNS") throughout nvi, which .
As an alternative instead of silently falling back to default values, it might make sense to abort vi with an error message, if we would crash anyway afterwards.

Note that there is an active upstream project for DragonFly's vi: <https://github.com/lichray/nvi2&gt;, which might be a better place to submit and discuss this change.

Actions #3

Updated by tuxillo over 3 years ago

  • Category set to Userland
  • Status changed from In Progress to Closed
  • Assignee set to tuxillo
  • % Done changed from 0 to 100

Fixed in b1ac2ebbae87355f573dc3a7ee05ea5756e778f7

Tested and it is no longer an issue.

Actions

Also available in: Atom PDF