Bug 227330

Summary: [PATCH] usr.bin/cut: Fix out of boundary write on illegal list argument
Product: Base System Reporter: tobias
Component: binAssignee: Eitan Adler <eadler>
Status: Closed FIXED    
Severity: Affects Only Me CC: cem, emaste
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to fix the issue none

Description tobias 2018-04-06 19:24:55 UTC
Created attachment 192296 [details]
Patch to fix the issue

It is possible to trigger an out of boundary write in cut if an invalid range with autostart has been supplied:

$ cut -c -8000-2
Segmentation fault

It is not verified that enough memory has been allocated for an autostart if a smaller stop value has been specified.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-05-23 09:16:53 UTC
A commit references this bug:

Author: eadler
Date: Wed May 23 09:16:21 UTC 2018
New revision: 334083
URL: https://svnweb.freebsd.org/changeset/base/334083

Log:
  cut: Fix out of boundary write on illegal list argument

  It is possible to trigger an out of boundary write in cut if an invalid
  range with autostart has been supplied.

  PR:		227330
  Submitted by:	tobias@stoeckmann.org

Changes:
  head/usr.bin/cut/cut.c