QColumns Issue in "v1.5.0g2"

  • Hi marcelvanherk

    I have this issue with 1.5.0g/g2. dicom.sql hasn't been changed but v1.5.0f didn't have the issue.

    Code
    20261012 11:04:27 Inconsistent StudyModal in DICOMStudies: PatientID = 'xxRS_PelvisHFS' StudyInsta = '1.2.392.200036.9116.2.6.1.3268.2056548474.1767409376.39617', Old='CT', New='RTSTRUCT\\CT'
    20261012 11:04:27 Inconsistent StudyModal in DICOMStudies: PatientID = 'xxRS_PelvisHFS' StudyInsta = '1.2.392.200036.9116.2.6.1.3268.2056548474.1767409376.39617', Old='RTSTRUCT\\CT', New='RTPLAN\\RTSTRUCT\\CT'
    20261012 11:04:27 ***Failed MYSQLExec : INSERT INTO DICOMImages (SOPInstanc, SOPClassUI, ImageNumbe, ImageDate, ImageTime, NumberOfFr, SamplesPer, PhotoMetri, QRows, QColumns, BitsStored, ImagePat, SeriesInst, AccessTime, ObjectFile, DeviceName) VALUES ('1.2.752.243.1.1.20260204180840947.1810.58500', '1.2.840.10008.5.1.4.1.1.481.2', '1', '20260204', '180840.000000', '103', '', 'MONOCHROME2', 'Œ', '', '', 'xxRS_PelvisHFS', '1.2.752.243.1.1.20260204180840947.1810.58500.1', 1791799456, 'xxRS_PelvisHFS\\20260103\\RTDOSE_1.2.752.243.1.1.20260204180840947.1810.58500.1\\RTDOSE_1_1_2_752_243_1_1_20260204180840947_1810_58500.dcm', 'MAG0')
    20261012 11:04:27 ***Error: Incorrect string value: '\x8C' for column 'QRows' at row 1
    20261012 11:04:27 ***Unable to DB.Add()
    20261012 11:04:27 ***SQL: INSERT INTO DICOMImages (SOPInstanc, SOPClassUI, ImageNumbe, ImageDate, ImageTime, NumberOfFr, SamplesPer, PhotoMetri, QRows, QColumns, BitsStored, ImagePat, SeriesInst, AccessTime, ObjectFile, DeviceName) VALUES ('1.2.752.243.1.1.20260204180840947.1810.58500', '1.2.840.10008.5.1.4.1.1.481.2', '1', '20260204', '180840.000000', '103', '', 'MONOCHROME2', 'Œ', '', '', 'xxRS_PelvisHFS', '1.2.752.243.1.1.20260204180840947.1810.58500.1', 1791799456, 'xxRS_PelvisHFS\\20260103\\RTDOSE_1.2.752.243.1.1.20260204180840947.1810.58500.1\\RTDOSE_1_1_2_752_243_1_1_20260204180840947_1810_58500.dcm', 'MAG0')
    20261012 11:04:27 ***Error: Incorrect string value: '\x8C' for column 'QRows' at row 1
    20261012 11:04:27 ***Error saving to SQL: xxRS_PelvisHFS\20260103\RTDOSE_1.2.752.243.1.1.20260204180840947.1810.58500.1\RTDOSE_1_1_2_752_243_1_1_20260204180840947_1810_58500.dcm

    I am attaching the level 4 debug log serverstatus.txt. Also attached my current ini dicom.ini.txt. Is there anything I am missing in config or settings wise?

    Could you please look into this? Thanks in advance

    Kidn regards,
    Mahesh

  • marcelvanherk If it helps, I tried looking through the code. I think the issue is in src/dgate/src/dbsql.cpp with MakeSafeStringValues() (around line 2719). Bringing back the per-type conversion before it falls back to GetString should solve it I guess:

    An inline switch with sprintf("%u", ...) for each type, copied from the old SetString, would work just as well.

    An unrelated second bug in VR::GetString: when the value is too long, it writes buf[max]=0, one byte past the end of the buffer. It should be strncpy(buf, Data, max-1); buf[max-1]=0;. I think this can corrupt memory.

    I think this would be the fix. you can check it yourself as I am not too familiar with C++.

  • Thank you. I have been forced to make loads of changes due to people using AI to find potential security issues (that become an issue after these are published). I hope these are the only errors that were introduced.

    Marcel van Herk is developer of the Conquest DICOM server together with Lambert Zijp.

  • marcelvanherk I do use AI to help with debugging, but without proper testing in parallel, it introduces a lot of regression without the full picture which is annoying. Please let me know when you patched this and I can re-test all these. Thanks.

  • marcelvanherk
    The fix works. I'll update you as I progress with other bits of testing.
    Could you please release this patch (I know its the just dgate update but it would be better if you released it for the easy deployment process)? Thanks much

    Edited once, last by SM1312 (October 12, 2026 at 4:26 PM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!