Ticket #58323: write-java.c.patch

File write-java.c.patch, 949 bytes (added by jmroot (Joshua Root), 5 years ago)
  • gettext-tools/src/write-java.c

    old new msgid_hashcode (const char *msgctxt, con 
    150150      char *combined;
    151151      unsigned int result;
    152152
    153       combined = (char *) xmalloca (combined_len);
     153      combined = (char *) xmalloca (combined_len + 1);
    154154      memcpy (combined, msgctxt, msgctxt_len);
    155155      combined[msgctxt_len] = MSGCTXT_SEPARATOR;
    156156      memcpy (combined + msgctxt_len + 1, msgid, msgid_len + 1);
    write_java_msgid (FILE *stream, message_ 
    416416      size_t combined_len = msgctxt_len + 1 + msgid_len;
    417417      char *combined;
    418418
    419       combined = (char *) xmalloca (combined_len);
     419      combined = (char *) xmalloca (combined_len + 1);
    420420      memcpy (combined, msgctxt, msgctxt_len);
    421421      combined[msgctxt_len] = MSGCTXT_SEPARATOR;
    422422      memcpy (combined + msgctxt_len + 1, msgid, msgid_len + 1);