Project

Profile

Help

Bug #2691

closed

longer custom path to

Added by Roger Martin over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
Saxon-C Internals
Start date:
2016-03-31
Due date:
% Done:

100%

Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
1.0.0
Fixed in version:
1.0.1
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:

Description

Hi,

When the SAXONC_HOME is set to a path longer than the "/usr/lib" the concatenation that uses dllname and resources_dir falls off the size of the memory allocated for each

SaxonCGlue.h

@

    "/usr/libr/libsaxonhec.so";  //rename according to product edition (hec or pec) Also make change in the c file

@

my local work around is

@

    "/usr/libr/libsaxonhec.so\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";  //rename according to product edition (hec or pec) Also make change in the c file

@

and similarly for resources_dir.

yet this could be too short too but for my use my custom path fits within.

in SaxonCGlue.c

@

if(getenv("SAXONC_HOME")!= NULL) {


	char * env = getenv("SAXONC_HOME");

	size_t env_len = strlen(env);

	size_t name_len =  15;

	size_t rDir_len = 11;

	//dllname =malloc(sizeof(char)*name_len);

	//resources_dir =malloc(sizeof(char)*rDir_len);

	memset(&dllname[0], 0, sizeof(dllname));

	memset(&resources_dir[0], 0, sizeof(resources_dir));

	strncat(resources_dir, env,  env_len);

	strncat(resources_dir, "/saxon-data", rDir_len);

	strncat(dllname, env, env_len);

	strncat(dllname, "/libsaxonhec.so", name_len); //rename according to product edition (-hec or -pec)

#ifdef DEBUG

	printf("resources_dir: %s\n", resources_dir);	

	printf("envDir: %s\n", env);

	printf("size of env %i\n", strlen(env));

	printf("size of dllname %i\n", strlen(dllname));

	printf("dllName: %s\n", dllname);

	printf("resources_dir: %s\n", resources_dir);

#endif

}

@

I don't think the strncat and related functions actually expand the allocation of these variables


Related issues

Related to SaxonC - Bug #3117: Unable to load libsaxoneec. with missing .so extensionClosedO'Neil Delpratt2017-01-26

Actions

Please register to edit this issue

Also available in: Atom PDF