Bug 9914 - Code generated from IDL could produce more informative error messages
Summary: Code generated from IDL could produce more informative error messages
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: DCE-RPCs and pipes (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jo Sutton
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks: 14504
  Show dependency treegraph
 
Reported: 2013-05-29 04:14 UTC by Richard Sharpe
Modified: 2023-10-01 23:47 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Sharpe 2013-05-29 04:14:21 UTC
I am not sure if this is fixed in master, but I noticed this in
pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm:

sub ParseArrayPullGetSize($$$$$$)
...
        $self->pidl("size_$e->{NAME}_$l->{LEVEL_INDEX} = $size;");
        my $array_size = "size_$e->{NAME}_$l->{LEVEL_INDEX}";

        if (my $range = has_property($e, "range")) {
                my ($low, $high) = split(/,/, $range, 2);
...
                $self->pidl("\treturn ndr_pull_error($ndr,
NDR_ERR_RANGE, \"value out of range\");");

It would be nice if this last had something like:

   \"value %u out of range $low..$high\", $array_size

Giving us more informative error messages is useful. It seems that the
range property appears in lots of places, so it would be nice if there
was more info on a failure to parse a field that had a range
attribute.
Comment 1 Samba QA Contact 2023-09-27 03:38:04 UTC
This bug was referenced in samba master:

ce43dd0571d0ae5703fb82f936a41566d3972a8e
Comment 2 Samba QA Contact 2023-10-01 23:47:05 UTC
This bug was referenced in samba master:

26e40717aa02106bd9a9b86157ba4cc25bfa98b7
773c36baa0ded91a75a046f6766acc3a8e45221c