Project

General

Profile

Actions

Bug #14030

closed

udf poorly handles its usage

Added by Robert Mustacchi 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

If you use udf without specifying any usage right now, it ultimately segfaults trying to parse a number. The problem is that we forgot an exit at the end of our usage statement.

Actions #1

Updated by Robert Mustacchi 3 months ago

I tested this by verifying that when no longer specifying options, it doesn't segfault. I also verified normal usage:

rm@iliad:~$ /usr/lib/udf 
udf: missing required arguments
Usage: udf [-l] -d device -f func -i inst -r reg
rm@iliad:~$ for reg in 0x200 0x204 0x208 0x210 0x214 0x218 0x220 0x224 0x228; do for f in $(seq 0  27); do pfexec /usr/lib/udf -d /devices/pseudo/amdzen\@0/zen_udf\@3\:zen_udf.0 -f 0 -i $f -r $reg; done; printf "\n"; done
ifr 0/0/200: 0x0
ifr 1/0/200: 0x0
ifr 2/0/200: 0x0
ifr 3/0/200: 0x0
ifr 4/0/200: 0x0
ifr 5/0/200: 0x0
ifr 6/0/200: 0x0
ifr 7/0/200: 0x0
ifr 8/0/200: 0x0
ifr 9/0/200: 0x0
ifr a/0/200: 0x0
ifr b/0/200: 0x0
ifr c/0/200: 0x0
ifr d/0/200: 0x0
ifr e/0/200: 0x0
ifr f/0/200: 0x0
ifr 10/0/200: 0xf000
ifr 11/0/200: 0xf000
ifr 12/0/200: 0xf000
...
Actions #2

Updated by Electric Monk 3 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 6881023fc43e5c6ac49e78f526f6cce9b68d69a3

commit  6881023fc43e5c6ac49e78f526f6cce9b68d69a3
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2021-08-24T00:14:28.000Z

    14030 udf poorly handles its usage
    Reviewed by: Peter Tribble <peter.tribble@gmail.com>
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed by: Sebastian Wiedenroth <wiedi@frubar.net>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF