Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 932c640 in mainline


Ignore:
Timestamp:
2021-08-08T13:17:18Z (2 months ago)
Author:
Manuele Conti <manuele.conti@…>
Children:
5f9a52e
Parents:
21b0013
git-author:
Manuele Conti <manuele.conti@…> (2021-08-08 13:17:05)
git-committer:
Manuele Conti <manuele.conti@…> (2021-08-08 13:17:18)
Message:

Add limit check about 10 pipes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/input.c

    r21b0013 r932c640  
    5656#include "tok.h"
    5757
     58#define MAX_PIPES 10U
     59
    5860extern volatile unsigned int cli_quit;
    5961
     
    9294        tokenizer_t tok;
    9395        unsigned int i, pipe_count;
    94         unsigned int pipe_pos[2];
     96        unsigned int pipe_pos[MAX_PIPES];
    9597        char *redir_from = NULL;
    9698        char *redir_to = NULL;
     
    153155                        break;
    154156                }
    155 
     157                if (pipe_count > MAX_PIPES) {
     158                        rc = ENOTSUP;
     159                        goto finit;
     160                }
    156161        }
    157162
Note: See TracChangeset for help on using the changeset viewer.