[CMD] Add missing memory allocation NULL checks (#161). CORE-8304

Adapted from a patch by Jacob S. Preciado.

Bring also the code suggestions emitted during review.
This commit is contained in:
Hermès Bélusca-Maïto 2017-12-03 18:49:41 +01:00
parent 73798d2e71
commit 3f892a8d6b
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
16 changed files with 293 additions and 147 deletions

View file

@ -45,10 +45,10 @@ extern BOOL bEcho; /* The echo flag */
extern TCHAR textline[BATCH_BUFFSIZE]; /* Buffer for reading Batch file lines */
LPTSTR FindArg (TCHAR, BOOL *);
LPTSTR BatchParams (LPTSTR, LPTSTR);
VOID ExitBatch (VOID);
INT Batch (LPTSTR, LPTSTR, LPTSTR, PARSED_COMMAND *);
BOOL BatchGetString (LPTSTR lpBuffer, INT nBufferLength);
LPTSTR FindArg(TCHAR, BOOL *);
LPTSTR BatchParams(LPTSTR, LPTSTR);
VOID ExitBatch(VOID);
INT Batch(LPTSTR, LPTSTR, LPTSTR, PARSED_COMMAND *);
BOOL BatchGetString(LPTSTR lpBuffer, INT nBufferLength);
LPTSTR ReadBatchLine(VOID);
VOID AddBatchRedirection(REDIRECTION **);