****************************************************************************/
#define strip_driver_path(_mem_ctx, _element) do { \
- if ((_p = strrchr((_element), '\\')) != NULL) { \
+ if (_element && ((_p = strrchr((_element), '\\')) != NULL)) { \
(_element) = talloc_asprintf((_mem_ctx), "%s", _p+1); \
W_ERROR_HAVE_NO_MEMORY((_element)); \
} \
WERROR err;
char *_p;
+ if (!*driver_path || !*data_file || !*config_file) {
+ return WERR_INVALID_PARAM;
+ }
+
/* clean up the driver name.
* we can get .\driver.dll
* or worse c:\windows\system\driver.dll !
strip_driver_path(mem_ctx, *driver_path);
strip_driver_path(mem_ctx, *data_file);
strip_driver_path(mem_ctx, *config_file);
- strip_driver_path(mem_ctx, *help_file);
+ if (help_file) {
+ strip_driver_path(mem_ctx, *help_file);
+ }
if (dependent_files && dependent_files->string) {
for (i=0; dependent_files->string[i]; i++) {
* i.e. only copy files that are newer than existing ones
*/
+ if (r->in.flags == 0) {
+ return WERR_INVALID_PARAM;
+ }
+
if (r->in.flags != APD_COPY_NEW_FILES) {
return WERR_ACCESS_DENIED;
}