summaryrefslogtreecommitdiff
path: root/miscutils/bc.c
diff options
context:
space:
mode:
authorDenys Vlasenko2018-12-06 15:21:39 +0100
committerDenys Vlasenko2018-12-06 15:21:39 +0100
commit4c9455f967e21d30db0de2e13b6e1115ab8f36ce (patch)
treeac535758f2a5257608289c571431b6ad6a53dc53 /miscutils/bc.c
parent52c210594cfc78c4d849550890c30a9185f36d9c (diff)
downloadbusybox-4c9455f967e21d30db0de2e13b6e1115ab8f36ce.zip
busybox-4c9455f967e21d30db0de2e13b6e1115ab8f36ce.tar.gz
dc: fix "dc does_not_exist" SEGVing
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils/bc.c')
-rw-r--r--miscutils/bc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 3d53db7..0200afc 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -1322,7 +1322,8 @@ static char* bc_read_file(const char *path)
size_t size = ((size_t) -1);
size_t i;
- buf = xmalloc_open_read_close(path, &size);
+ // Never returns NULL (dies on errors)
+ buf = xmalloc_xopen_read_close(path, &size);
for (i = 0; i < size; ++i) {
char c = buf[i];