diff -crwb libxslt-1.1.27/libxslt/functions.c 688171-patch-libxslt-1.1.27/libxslt/functions.c
*** libxslt-1.1.27/libxslt/functions.c	2012-09-12 11:26:36.000000000 +0100
--- 688171-patch-libxslt-1.1.27/libxslt/functions.c	2012-11-15 12:47:30.228247021 +0000
***************
*** 662,668 ****
      xmlNodePtr cur = NULL;
      xmlXPathObjectPtr obj = NULL;
      long val;
!     xmlChar str[30];
      xmlDocPtr doc;
  
      if (nargs == 0) {
--- 662,670 ----
      xmlNodePtr cur = NULL;
      xmlXPathObjectPtr obj = NULL;
      long val;
!     long doc_val;
!     static char base_address;
!     xmlChar str[48];
      xmlDocPtr doc;
  
      if (nargs == 0) {
***************
*** 716,726 ****
          xmlXPathFreeObject(obj);
  
      val = (long)((char *)cur - (char *)doc);
!     if (val >= 0) {
!       sprintf((char *)str, "idp%ld", val);
!     } else {
!       sprintf((char *)str, "idm%ld", -val);
!     }
      valuePush(ctxt, xmlXPathNewString(str));
  }
  
--- 718,727 ----
          xmlXPathFreeObject(obj);
  
      val = (long)((char *)cur - (char *)doc);
!     doc_val = (long)((char *)doc - (char *)&base_address);
!     snprintf((char *)str, sizeof(str), "id%c%ld%c%ld",
!         "pm"[doc_val<0], doc_val<0 ? -doc_val:doc_val, "pm"[val<0], val<0 ? -val:val);
! 
      valuePush(ctxt, xmlXPathNewString(str));
  }
  
