Changeset 0460377 in mainline


Ignore:
Timestamp:
2025-04-25T15:43:15Z (12 days ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
4b9213d
Parents:
a22c62f
git-author:
Miroslav Cimerman <70661600+mcimerman@…> (2025-04-25 15:43:15)
git-committer:
GitHub <noreply@…> (2025-04-25 15:43:15)
Message:

uspace/app/blkdump: fix argv null deref (#251)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/blkdump/blkdump.c

    ra22c62f r0460377  
    9595        }
    9696
    97         if (str_cmp(*argv, "--offset") == 0) {
     97        if (*argv && str_cmp(*argv, "--offset") == 0) {
    9898                --argc;
    9999                ++argv;
     
    115115        }
    116116
    117         if (str_cmp(*argv, "--count") == 0) {
     117        if (*argv && str_cmp(*argv, "--count") == 0) {
    118118                --argc;
    119119                ++argv;
     
    136136
    137137devname:
     138        if (*argv == NULL) {
     139                printf(NAME ": Error, argument missing (device_name).\n");
     140                syntax_print();
     141                return 1;
     142        }
     143
    138144        if (argc != 1) {
    139145                printf(NAME ": Error, unexpected argument.\n");
Note: See TracChangeset for help on using the changeset viewer.