diff --git a/NEWS b/NEWS index f15ffc49..3cbb9663 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.33 (???): + * xbps-dgraph: fixed a segfault if rootdir wasn't set: + issue #33: https://github.com/voidlinux/xbps/issues/33 + * xbps-uhelper now supports downloading files with a defined destination. The syntax of fetch is "URI>FILENAME". So if you call diff --git a/bin/xbps-dgraph/main.c b/bin/xbps-dgraph/main.c index 82a04c7d..ad08a475 100644 --- a/bin/xbps-dgraph/main.c +++ b/bin/xbps-dgraph/main.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2013 Juan Romero Pardines. + * Copyright (c) 2010-2014 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -479,7 +479,9 @@ main(int argc, char **argv) /* Initialize libxbps */ memset(&xh, 0, sizeof(xh)); - strncpy(xh.rootdir, rootdir, sizeof(xh.rootdir)); + if (rootdir != NULL) + strncpy(xh.rootdir, rootdir, sizeof(xh.rootdir)); + if ((rv = xbps_init(&xh)) != 0) die("failed to initialize libxbps: %s", strerror(rv));