Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
procps.31624
0037-fail-on-null-string-for-arguments.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0037-fail-on-null-string-for-arguments.patch of Package procps.31624
From c304ffa994c2beacf3eabf9986a67d2065b60cc4 Mon Sep 17 00:00:00 2001 From: Ryan Cox <ryan_cox@byu.edu> Date: Mon, 28 Oct 2013 21:05:35 -0600 Subject: [PATCH] fail on null string for arguments --- pgrep.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git pgrep.c pgrep.c index 6290ec5..38c380b 100644 --- pgrep.c +++ pgrep.c @@ -142,13 +142,19 @@ static int __attribute__ ((__noreturn__)) usage(int opt) static struct el *split_list (const char *restrict str, int (*convert)(const char *, struct el *)) { - char *copy = xstrdup (str); - char *ptr = copy; + char *copy; + char *ptr; char *sep_pos; int i = 0; int size = 0; struct el *list = NULL; + if (str[0] == '\0') + return NULL; + + copy = xstrdup (str); + ptr = copy; + do { if (i == size) { size = size * 5 / 4 + 4; -- 1.7.9.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor